[web] Standards?!

Started by
6 comments, last by Etnu 19 years, 1 month ago
If I want to use CSS, and be completely standard compliant with my XHTML, is it unsound to define and use elements like < B> and < I> and < PRE> et cetera? I've heard a lot of those elements are no longer used (depreciated), is this true? I guess I don't understand what elements are okay to use and which ones are frowned upon. If I define the look and feel of a < B> element in my CSS file, is it still bad practice to use it in my XHTML? And if so, what else do I use when I want boldness arbitrarily? Thanks for clarification. I am not specifically pointing out the < B> element either, I mean.. in general, any element that is trying to be phased out or used less and less. You know.. Thanks.
I am not worthy of a sig! ;)
Advertisement
Quote:Original post by jim bob
If I want to use CSS, and be completely standard compliant with my XHTML, is it unsound to define and use elements like < B> and < I> and < PRE> et cetera? I've heard a lot of those elements are no longer used (depreciated), is this true? I guess I don't understand what elements are okay to use and which ones are frowned upon.

If I define the look and feel of a < B> element in my CSS file, is it still bad practice to use it in my XHTML? And if so, what else do I use when I want boldness arbitrarily?

Thanks for clarification. I am not specifically pointing out the < B> element either, I mean.. in general, any element that is trying to be phased out or used less and less. You know..

Thanks.

Hi Jim Bob,

While the <b>, <i>, and a number of other tags are considered depreciated by W3C standards in XHTML, they aren't necessarily out of the question when designing your webpage. It all comes down to the doctype you decide to use, with XHTML 1.0 it can be either transitional, strict, or frameset.

Transitional is the most commonly used and allows the use of HTML 4 tags, including your aforementioned <b>, <i> and <pre> tags. Strict is when you define all page attributes in a stylesheet and stick with either the @import or link to bring your layout properties into your page. Either works well but if you're looking to keep some of your old tags for on-the-fly formating, stick with the transitional doctype.

Hope this helps, let me know if you need further clarification.
I'd recommend using <em> and <strong> now instead of b and i, for the simple fact that they more accurately convey the purpose of the tags (of course, them being deprecated makes a difference as well)

I made it so that the WYSIWYG editor that we use in our CMS automatically replaces b and i tags. Not a big deal.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Okay, thanks guys!

Um, would it be logical to use the STRICT type? Can I use < EM> and < STRONG> with that, or no? Where can I find a list of XHTML commands I can use then, in STRICT?

And how would I do on-the-fly formatting if I used STRICT? Those SPAN tags, or what?
I am not worthy of a sig! ;)
An XHTML tag list can be found at http://www.w3schools.com/xhtml/xhtml_reference.asp. Use things like em, stong, big, small, etcetera for on-the-fly formatting. For everything else there's CSS definitions.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Quote:Original post by Sander
An XHTML tag list can be found at http://www.w3schools.com/xhtml/xhtml_reference.asp. Use things like em, stong, big, small, etcetera for on-the-fly formatting. For everything else there's CSS definitions.

Exactly what Sander said. Also if you'd like to keep super-strict, you can always do in-line styles with the style attribute. Here's an example of how to do bold-like font change to some text:

<p style="font-weight: bold;">text text text</p>
Quote:Original post by Interpolitika
<p style="font-weight: bold;">text text text


I would only use that at the *very* last resort because it violates the "spirit" of CSS: separation from contents and presentation. With style attributes you are mixing again. Sometimes it's unfortunately nessecary but if you can do without inline styling then do so!.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Quote:Original post by jim bob
Okay, thanks guys!

Um, would it be logical to use the STRICT type? Can I use < EM> and < STRONG> with that, or no? Where can I find a list of XHTML commands I can use then, in STRICT?

And how would I do on-the-fly formatting if I used STRICT? Those SPAN tags, or what?


I use strict because it's the only way to get all major browsers to render in standards-compliant mode.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

This topic is closed to new replies.

Advertisement