7
webketje
16d

If you display:block a <span>, just take a <div> man.

Comments
  • 1
    I giggled 😅
  • 2
    - throws up the <div/> hand sign -
  • 1
    Also, please never add line breaks after your <span>s
  • 2
    I just used a span with a display block, will change it 😅
  • 1
    I do inline-block, I'm chill.
  • 0
    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.
  • 1
    @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.
Add Comment