You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In essence display: flex, display: grid and display: table + float hacks already give a lot of flexibility on rendering layout. However more often than not authors have to add div / span just for rendering/presentation purposes.
Proposal
Add ::around or ::wrap pseudo-elements.
Example Use Case
/* horizontally centered article having a max-width */article {
max-width:500px;
margin:0 auto;
}
article.with-background::around,/* fully stretched background if class given */article.nth(2)::around { /* fully stretched background on every 2nd element */display: block;
width:100%;
background: orange;
}
Usually these presentional-only boxes would require extra divs in the dom.
I think @Hixie is right when he said it WONTFIX in HTML and I think @tabatkins is wrong when he says that it WONTFIX on either level. We are getting close due to display: grid and display: flex but it is not always sufficient. #588 has enough and good examples.
From #588 I can see that implementors don't see it as something to be implemented easily. However I wonder how ::before and ::after made it then. What is the difference here? A pseudo element is being injected for the cases of ::before as well as ::wrap.
Didn't know #588 existed and strange enough I came to a very similar solution.
At least the W3C guides say that you should think about authors first.
Closing as duplicate of #588. We should solve these use cases directly, e.g. by extending the background clip area or having more powerful options for controlling padding.
In essence
display: flex
,display: grid
anddisplay: table
+ float hacks already give a lot of flexibility on rendering layout. However more often than not authors have to adddiv
/span
just for rendering/presentation purposes.Proposal
Add
::around
or::wrap
pseudo-elements.Example Use Case
Usually these presentional-only boxes would require extra divs in the dom.
VS
OR
Codepen Examples
Div Wrapper: http://codepen.io/anon/pen/jyWqqE
Pseudo Wrapper: http://codepen.io/anon/pen/JEGKKw
The text was updated successfully, but these errors were encountered: