What are some XHTML / Validation basics?
<i> vs. <em> (and <b> vs. <strong>)
All of those tags are perfectly valid to use. However, <em> and <strong> have semantic meaning to them (emphasized text and strong text) whereas <i> and <b> are purely non-semantic and presentational. So, if you have text and you’re italicizing or bolding it in order to emphasize it in some way then the correct/semantic thing would be to use <em> or <strong>.
Some generalized basics of XHTML:
- all attribute values must be enclosed in single/double quotes (I personally prefer double-quotes, but it doesn’t really matter)
- all tags must be lowercase (i.e. <div> not <DIV>)
- all tag attributes must be lowercase (i.e. <div id="bob"> not <div ID="bob">)
- tags need to be nested properly
- “block" level elements typically need to be included inside another block-level element and are not valid inside an inline-level element
- inline-level elements cannot contain block-level elements
- images require the alt="text” attribute
- all tags must be closed, so tags that traditionally don’t have a closing pair can be implicitly closed: <img />, <input />, <br />, <link />, <meta />, etc.
Category: ExpressionEngine Basics, Technical Issues, Troubleshooting
