Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Text needs to be auto-width for desktop, but 100% width for mobile.
Very common use case.
One could change their entire layout to one column with just
span {
display: block;
}
Inline-block would maybe still be better... but it would work. -
@HiFiWiFiSciFi span is not meant for layout, span is meant for inline styling and semantics. Span shouldn't contain an entire paragraph, that would be <p>.
In the usecase you provided the right thing to do would be to enclose the span in a div, p tag or other block-level element and apply layout changes to that.
Related Rants
If you display:block a <span>, just take a <div> man.
joke/meme
html & css
joke but will be useful
saying