Results 1 to 4 of 4

Thread: HTML - Emphasize value

  1. #1
    Join Date
    Feb 2008
    Posts
    130

    HTML - Emphasize value

    Hello,

    I am displaying a list of statistics where each statistic has a value
    and a phrase:

    8 articles published

    I want to emphasize the number 8 by giving it a bigger size and making
    its weight bold.

    How should my HTML markup be?
    <ul>
    <li><span>8</span> articles published</li>
    <li>...</li>
    </ul>

    ul li {
    font: normal 0.75em Georgia, Utopia, Palatino, 'Palatino
    Linotype', serif;
    padding: 4px 0;
    }

    ul li span {
    font: bold 1.5em Georgia, Utopia, Palatino, 'Palatino
    Linotype', serif;
    }

    or maybe:

    <ul>
    <li><p><span>8</span> articles published</p></li>
    <li>...</li>
    </ul>

    ul li {padding: 4px 0;

    ul li p {
    font: normal 0.75em Georgia, Utopia, Palatino, 'Palatino
    Linotype', serif;
    }

    ul li p span {
    font: bold 1.5em Georgia, Utopia, Palatino, 'Palatino
    Linotype', serif;
    }

    Or maybe some other option?

    Thanks,

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: HTML - Emphasize value

    Why the extra P? Do you feel compelled to add an extra element or are
    your really listing paragraphs!

  3. #3
    Join Date
    Apr 2008
    Posts
    142

    Re: HTML - Emphasize value

    Is there HTML markup for emphasis?
    The <span> markup is by definition meaningless, semantically empty. Read the
    group for a while and you'll learn about this.
    Why do you set the font size 25% smaller than the user-selected size?

    Here's adequate markup:

    <ul class="stats">
    <li><strong>8</strong> articles published</li>
    <li>...</li>
    </ul>

    Alternatively, you could use <em> instead of <strong>, but this sounds more
    like strong and global emphasis rather than the within-text emphasis that <em> "really" means. Either way you need to pay attention to typical default
    rendering when designing your style sheet, which could be e.g.

    .stats li {
    font-family: Georgia, Utopia, Palatino, 'Palatino Linotype', serif;
    padding: 0.25em;
    }
    .stats strong {
    font-size: 1.5em;
    font-weight: bold;
    }

    Here font-weight: bold just confirms the typical default rendering.

    By typographic tradition, bolding is normally use with sans-serif fonts, whereas italics and small-caps are normal emphasis methods for serif text.
    We need not take this too seriously in web authoring (partly because small-caps isn't really supported and italics is often too unnoticeable on screen), but I think everyone should know the tradition and then _consciously_ deviate from it when appropriate.

    Don't forget the possibility of coloring text or background for emphasis.
    The cost nothing on the web, unlike in print.

  4. #4
    Join Date
    Feb 2008
    Posts
    130

    Re: HTML - Emphasize value

    Thank you for the explanation.

    I am using Georgia because I wanted its looks on this case and 1em
    looks to big for the purpose of displaying a text line with
    statistical info.

    Should I use Georgia only for heading?

    Thanks,

Similar Threads

  1. html help
    By saffu khan in forum Software Development
    Replies: 3
    Last Post: 03-05-2010, 01:01 PM
  2. XML vs HTML
    By technika in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 09:14 AM
  3. Replies: 3
    Last Post: 22-09-2009, 01:12 PM
  4. HTML and CSS to PDF
    By Miltongomes in forum Software Development
    Replies: 3
    Last Post: 18-03-2009, 10:25 PM
  5. How do I get the HTML code to display as HTML code?
    By NAYASA in forum Software Development
    Replies: 3
    Last Post: 26-12-2008, 01:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,898,123.74428 seconds with 16 queries