First of all XHTML isn't all it's cracked up to be, and HTML 4.01 strict has very much the same restrictions as XHTML, only slightly different (in HTML there are none of those annoying self closing tags and, though not a good idea, upper and lower case letters may be mixed more freely in your code, there are a few other differences). Most XHTML on the web today is being served as HTML, and then (as such) needs to be error corrected by the browser.
For more on this see:
http://www.webdevout.net/articles/beware-of-xhtml
Anyways, to answer your questions, and BTW, all of that stuff is deprecated in HTML 4.01 strict as well, though some may be allowed, not a good idea if you want your code to stand the test of time. These changes are in large part to foster consistency across browsers and to separate content (markup) from presentation (style). Now if you wanted a center tag, it would have been like so:
HTML Code:
<center>
some content, can include many other elements and be very long or very short
</center>
This is still valid under some DTD's. But it was never really clear what it meant. Generally it meant everything in there was centered - text, other block level and inline elements. However this didn't always work out as intended, especially where absolutely positioned elements were concerned. In any case it was a little like using a sledgehammer to drive a nail. And different browsers still do it differently.
If you want to center a block level element, what you can do is give it a style width and a margin of 0 auto in your css:
Code:
.myCenteredDivs {
width: 21em;
margin: 0 auto;
}
If you want text and inline elements within a block level element to be centered:
Code:
.myCenteredTextDivs {
text-align: center;
}
The two may be combined. Using text-align center for a container that has other block level elements in it can still get you in trouble at times.
A replacement for the font tag, would be a span tag with its font properties defined in style. But you need not use a ton of span tags like you often did with the font tag because you may also give font style properties to any element that may contain text nodes. There are actually many more style properties (most have different names) that relate to font than there were options for the font tag. The only thing missing is color, and that can be replaced by the style color property. See also:
http://www.eskimo.com/~bloo/indexdot.../font/font.htm
for more on what you can do with fonts in css style. There are also other things that can be done with text in css style like letter-spacing:
http://www.eskimo.com/~bloo/indexdot...etterspace.htm
Which has at its top links to other text related styles you may use.
The u tag may be replaced by using the text-decoration: underline style:
Code:
.myU {
text-decoration: underline;
}
Bookmarks