/    Sign up×
Community /Pin to ProfileBookmark

Flex does not work on Safari

This works on “every browser” (…I have tested πŸ™‚ on Mac, PC and Android but not Safari. My intention is to use a minimum of Javascript. Hence I try to use “details/summary”, but this fails on The New Internet Explorer (Safari)

[url=https://postimages.org/][img]https://i.postimg.cc/CLSdHSfd/details.png[/img][/url]

My simple question is if there is a work around that lines the text correct on Safari?

https://jsfiddle.net/z3ko4ra7/

My wild guess is that this fails on Safari.

“`
summary {
display: flex; <—— Does not work on Safari
height: 42px;
width: 200px;
list-style-type: none;
outline: none;
}
“`

to post a comment
CSSHTML

6 Comments(s) ↴

Copy linkTweet thisAlerts:
@cootheadSep 21.2022 β€”Β Hi there sibert.

according to caniuse.com...

[url=https://caniuse.com/?search=flex][u][b][color=#00f]flex[/color][/b][/u][/url]

...appears to be fully supported.

[i]coothead[/i]
Copy linkTweet thisAlerts:
@sibertauthorSep 21.2022 β€”Β > @coothead#1647285 according to caniuse.com...

Yes, but not when using "summary" (on Safari).
Copy linkTweet thisAlerts:
@sibertauthorSep 21.2022 β€”Β Finally I found a solution.

``<i>
</i>summary span{ &lt;----added &lt;span&gt; tag
display: flex;
height: 42px;
width: 200px;
list-style-type: none; &lt;---added this to make work on other browsers
outline: none;
}<i>
</i>
``


https://jsfiddle.net/9685ow32/
Copy linkTweet thisAlerts:
@sibertauthorSep 22.2022 β€”Β The work around was &lt;span&gt; on Safari, but this makes it harder to position the chevron to the right.

Could this be done in a more logical and simpler way?

Now it looks good direct in Safari, but not in any other browser

``<i>
</i>details &gt; summary &gt; span::after {
content: url(https://go4webdev.org/icn/chevronright.svg);
position: absolute;
margin-left: 170px;
margin-top: 5px;
}<i>
</i>
``


https://jsfiddle.net/8wbn1fkx/8/
Copy linkTweet thisAlerts:
@SempervivumSep 22.2022 β€”Β I changed the CSS of the `::after</C> to this:
<CODE>
`<i>
</i>details &gt; summary &gt; span::after {
content: url(https://go4webdev.org/icn/chevronright.svg);
/* position: absolute;
margin-left: 170px;
margin-top: 5px; */
margin-left: auto;
}<i>
</i>
`</CODE>
and it looks fine in Opera. I'm curious if it does the same in Safari.<br/>
<JSFIDDLE id="2fhvc0kr" revision="3" user="Sempervivum"><URL url="https://jsfiddle.net/Sempervivum/2fhvc0kr/3/">https://jsfiddle.net/Sempervivum/2fhvc0kr/3/</URL></JSFIDDLE>

I found this usage of <C>
margin: auto;`
here:

https://stackoverflow.com/questions/32551291/in-css-flexbox-why-are-there-no-justify-items-and-justify-self-properties/33856609#33856609
Copy linkTweet thisAlerts:
@sibertauthorSep 22.2022 β€”Β > @Sempervivum#1647348 and it looks fine in Opera. I'm curious if it does the same in Safari.

YES! Finally it works on all tested browsers. Thank you!

https://jsfiddle.net/5byp1jk2/1/
Γ—

Success!

Help @sibert spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 β€” BETA 4.24,
whats_new: community page,
up_next: more Davinciβ€’003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinciβ€’003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...