Sign in to follow this  
jim bob

[web] Standards?!

Recommended Posts

jim bob    132
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.

Share this post


Link to post
Share on other sites
Interpolitika    122
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.

Share this post


Link to post
Share on other sites
Etnu    880
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.

Share this post


Link to post
Share on other sites
jim bob    132
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?

Share this post


Link to post
Share on other sites
Interpolitika    122
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>

Share this post


Link to post
Share on other sites
Sander    1332
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!.

Share this post


Link to post
Share on other sites
Etnu    880
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this