Treehouse: Grow your CSS skills. Land your dream job.

How you do stylize text?

  • # November 7, 2009 at 1:27 am

    When you need to change text with a css class what do you use when you <p class=" "> isn’t an option? the paragraph tag treats the text like a block causing the line breaks.

    So, other than a <div> or <p> what do you guys resort to?

    # November 7, 2009 at 1:42 am

    <span> ?

    # November 7, 2009 at 2:12 am

    good one.

    Note: I’m not asking how to do it. I was curious how other do it :)

    # November 7, 2009 at 2:24 pm

    Depends on the purpuse.

    Sometimes I use <em>, <strong> and indeed, <span>

    <strong> or <em> doesn’t always have to be bolded or Italicized. You can undo that in css.
    Somtimes using <em> and <strong> is appropiate (semantics), but sometimes it can also be non-semantic.

    But long story short, a <span> always does the job, and if you want your span to be bold aswell, then you can always use <strong>, saving you a line of CSS (same goes for italic text, using <em>)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.