Technosailor.com Readers! Donate today to assist the Partners in Health Haiti Relief in their efforts.

22 February 2006 25 Comments

XHTML in Blog Posts

Blog Building BlocksMany blog editors provide a WYSIWYG and some do a fine job. There are some great desktop editors like Ecto (Mac and Windows) and Qumana which also provide interfaces to blogging.

While these tools make writing easy and straightforward, there’s always a need for some rudimentary HTML knowledge at the minimum. Some of the older web IDEs like Frontpage and older versions of Dreamweaver generate code that is both ugly and invalid – that is it doesn’t meet minimum expected standards for modern browsers. In order to keep your blog light (in terms of page weight, number of kb of data per page required for a user to download), and to ensure that your blog displays properly on all browsers (not just Internet Explorer!) make sure that the HTML that is used in your posting follows these guidelines.

1
<strong>

,

1
<b>

tags
These tags create boldfaced text. However, the difference here is semantic versus presentational – what does the formatted text mean? The

1
<strong>

tag provides a strong voice, an exclamation mark. “No, you can’t do that!”, while the

1
<b>

tag simply provide boldfaced. For example, the beginning of a sentence might require bold face, especially to begin a paragraph.

Recommended: It is actually recommended that the

1
<b>

tag be replaced with CSS:

1
<span style="font-weight:bold;">

.

1
<em>

,

1
<i>

tags
Similar to boldface tags, these tags provide italicized formatting to text. Also similar to bold faced formatting, there are semantic differences.

1
<em>

, as the tag denotes, provides emphasis: Yes, little Johnny did go to the mall… with his mother!. The

1
<i>

tag provides simple formatting: I read an article today in The Washington Post that…

Recommended: Similar to boldface, the

1
<i>

tag is often replaced with its CSS equivalent:

1
<span style="font-style:italic;">

.

Lists and bullets
Readers like lists and lists are easy to implement. When you have a number of points, if it makes sense to use an ordered list (1, 2, 3…) try code like:

1
2
3
4
5
<ol>
     <li>Apple</li>
     <li>Orange</li>
     <li>Peach</li>
</ol>

This will display:
1. Apple
2. Orange
3. Peach

Unordered (bulleted) lists are similar:

1
2
3
4
5
<ul>
     <li>Apple</li>
     <li>Orange</li>
     <li>Peach</li>
</ul>
  • Apple
  • Orange
  • Peach
  • I can go on. Really, I can. Much of the HTML that you will need you will inevitably pick up and that’s how I’ve learned it. There’s also more structural HTML that will come into play if you take a hands on approach to layout. Many bloggers though choose prebuilt themes and that is okay. Hopefully this gives a basic overview of some of the functional HTML you may need in day to day posting?

    Anyone else have anything to add to this?

    Pick up your copy of the WordPress Bible, a wildly popular resource for beginners and experts alike.

    Popularity: 1% [?]

    25 Responses to “XHTML in Blog Posts”

    1. Jon Husband 22 February 2006 at 2:03 pm #

      Hi, Aaaron .. we hope that you like the Qumana app, tho it looks like you have a certain level of mastery over whatever you may want to do on a blog. And, in that respect .. it also looks to me like you will be able to offer us feedback that will help in our ongoing quest to make Q the best blogging tool available.

      And, finally, as an irrelevant aside .. I have been trying to figure out, using online dictionaries, whether there are two spellings for *aficionado* … I’ve only found the one-f version so far ;-)

    2. Jon Husband 22 February 2006 at 2:03 pm #

      Hi, Aaaron .. we hope that you like the Qumana app, tho it looks like you have a certain level of mastery over whatever you may want to do on a blog. And, in that respect .. it also looks to me like you will be able to offer us feedback that will help in our ongoing quest to make Q the best blogging tool available.

      And, finally, as an irrelevant aside .. I have been trying to figure out, using online dictionaries, whether there are two spellings for *aficionado* … I’ve only found the one-f version so far ;-)

    3. Jon Husband 22 February 2006 at 2:03 pm #

      Hi, Aaaron .. we hope that you like the Qumana app, tho it looks like you have a certain level of mastery over whatever you may want to do on a blog. And, in that respect .. it also looks to me like you will be able to offer us feedback that will help in our ongoing quest to make Q the best blogging tool available.

      And, finally, as an irrelevant aside .. I have been trying to figure out, using online dictionaries, whether there are two spellings for *aficionado* … I’ve only found the one-f version so far ;-)

    4. Aaron 22 February 2006 at 2:19 pm #

      Checkmate. :-)

    5. Aaron 22 February 2006 at 2:19 pm #

      Checkmate. :-)

    6. Aaron 22 February 2006 at 2:19 pm #

      Checkmate. :-)

    7. Vinnie Garcia 27 February 2006 at 9:46 am #

      “Recommended: It is actually recommended that the tag be replaced with CSS: .”

      That’s just trading one presentational evil (b tags) for another (inline style).

      What really should be done, if it’s purely presentational, is using a CSS class that denotes the type of content, or even better using some kind of selector already built into CSS. Example:
      p:first-line { font-weight: bold }

      Of course, this might not be the optimal solution when you just want to bang out something bold in a post quickly, since you probably don’t want to mess with your CSS as you post.

    8. Vinnie Garcia 27 February 2006 at 9:46 am #

      “Recommended: It is actually recommended that the tag be replaced with CSS: .”

      That’s just trading one presentational evil (b tags) for another (inline style).

      What really should be done, if it’s purely presentational, is using a CSS class that denotes the type of content, or even better using some kind of selector already built into CSS. Example:
      p:first-line { font-weight: bold }

      Of course, this might not be the optimal solution when you just want to bang out something bold in a post quickly, since you probably don’t want to mess with your CSS as you post.

    9. Vinnie Garcia 27 February 2006 at 9:46 am #

      “Recommended: It is actually recommended that the tag be replaced with CSS: .”

      That’s just trading one presentational evil (b tags) for another (inline style).

      What really should be done, if it’s purely presentational, is using a CSS class that denotes the type of content, or even better using some kind of selector already built into CSS. Example:
      p:first-line { font-weight: bold }

      Of course, this might not be the optimal solution when you just want to bang out something bold in a post quickly, since you probably don’t want to mess with your CSS as you post.

    10. Ianiv Schweber 27 February 2006 at 12:01 pm #

      Yes, if you want to force the text to be bold or italic then use those CSS styles. But, most of the time people use those styles to add emphasis or use a stronger voice and the and tags should be used.

      If you use these tags then people who are not consuming your content using a normal text browser will also be able to understand the type of emphasis that you meant. For example, in a text-to-speech application “font-weight: bold” doesn’t mean anything, but “” might change the tone of the voice produced by the program.

    11. Ianiv Schweber 27 February 2006 at 12:01 pm #

      Yes, if you want to force the text to be bold or italic then use those CSS styles. But, most of the time people use those styles to add emphasis or use a stronger voice and the and tags should be used.

      If you use these tags then people who are not consuming your content using a normal text browser will also be able to understand the type of emphasis that you meant. For example, in a text-to-speech application “font-weight: bold” doesn’t mean anything, but “” might change the tone of the voice produced by the program.

    12. Ianiv Schweber 27 February 2006 at 12:01 pm #

      Yes, if you want to force the text to be bold or italic then use those CSS styles. But, most of the time people use those styles to add emphasis or use a stronger voice and the and tags should be used.

      If you use these tags then people who are not consuming your content using a normal text browser will also be able to understand the type of emphasis that you meant. For example, in a text-to-speech application “font-weight: bold” doesn’t mean anything, but “” might change the tone of the voice produced by the program.

    13. Aaron 27 February 2006 at 12:55 pm #

      Thanks for the feedback, guys.

    14. Aaron 27 February 2006 at 12:55 pm #

      Thanks for the feedback, guys.

    15. Aaron 27 February 2006 at 12:55 pm #

      Thanks for the feedback, guys.

    16. Ianiv Schweber 27 February 2006 at 1:23 pm #

      Heh, I guess my comment doesn’t really make sense after Wordpress ate my <strong> and <em> tags :)

      Something else I just thought about: If you have a blog at Wordpress.com inline styles are removed from posts.

    17. Ianiv Schweber 27 February 2006 at 1:23 pm #

      Heh, I guess my comment doesn’t really make sense after Wordpress ate my &lt;strong&gt; and &lt;em&gt; tags :)

      Something else I just thought about: If you have a blog at Wordpress.com inline styles are removed from posts.

    18. Ianiv Schweber 27 February 2006 at 1:23 pm #

      Heh, I guess my comment doesn’t really make sense after Wordpress ate my &lt;strong&gt; and &lt;em&gt; tags :)

      Something else I just thought about: If you have a blog at Wordpress.com inline styles are removed from posts.

    19. Aaron 27 February 2006 at 2:18 pm #

      Haha…. You’re messing up my thread laniv… :p

      1
      &lt;strong&gt;

      and

      1
      &lt;em&gt;
    20. Aaron 27 February 2006 at 2:18 pm #

      Haha…. You’re messing up my thread laniv… :p

      1
      &amp;lt;strong&amp;gt;

      and

      1
      &amp;lt;em&amp;gt;
    21. Aaron 27 February 2006 at 2:18 pm #

      Haha…. You’re messing up my thread laniv… :p

      1
      &amp;lt;strong&amp;gt;

      and

      1
      &amp;lt;em&amp;gt;
    22. Aaron 27 February 2006 at 2:19 pm #

      Frick….

    23. Aaron 27 February 2006 at 2:19 pm #

      Frick….

    24. Aaron 27 February 2006 at 2:19 pm #

      Frick….


    Trackbacks/Pingbacks.

    1. Autarky » Links for February 22, 2006 - 22. Feb, 2006

      [...] Office 2007 Screenshots So Your Content Has Been Copied, Now What? Windows bumps Unix as top server OS Technorati Favorites- Full post coming soon Larry Brilliant, and Other Forum News | Photos1.blogger.com? | Google Research Blog | Gaaagle | Life BETA Identity Theft | Google Image Search Infringing Copyright? Edgeio, a Web 2.0 answer to Craigslist? MySpace is the New Blogosphere I want to grow UP! | Ask MetaFilter XHTML in Blog Posts [...]