我们进行CSS网页布局的时候,都知道它需要符合XHTML1.0规范,在jb51.net昨天的文章中,向大家介绍了DTD。如果我们在进行CSS网页布局的时候,还在使用被W3C废弃的元素,那就失去了使用CSS的意义,虽然它们可能同样被样式控制。
在XHTML中不再使用HTML中的一些废弃元素。它们主要有以下一些。
ElementsandattributesthathavebeendeprecatedinthemostrecentversionofXHTML,XHTML1.0.
Elements
<applet></applet>
Theappletelementhasbeendeprecatedinfavorof<object></object>.
<basefont/>
Thebasefontelementhasbeendeprecatedinfavorofstylesheets.
<blackface></blackface>
TheblackfaceelementisaWebTV(MSNTV)elementthathasbeendeprecatedinfavorofstylesheets.
<blockquote></blockquote>
Theblockquoteelementisdeprecatedinfavorofstylesheetswhenusedtoindenttext.
<center></center>
Thecenterelementhasbeendeprecatedinfavorofstylesheets.
<dir></dir>
Thedirelementhasbeendeprecatedinfavorof<ul></ul>.
<embed/>
Theembedelementhasbeendeprecatedinfavorof<object></object>.
<font></font>
Thefontelementhasbeendeprecatedinfavorofstylesheets.
<i></i>
Theielementhasbeendeprecatedinfavorofstylesheets.
<isindex/>
TheisindexelementhasbeendeprecatedinfavoroftheinputelementandCGIforms.
<layer></layer>
Thelayerelementhasbeendeprecatedinfavorofstylesheets.
<menu></menu>
Themenuelementhasbeendeprecatedinfavorof<ul></ul>.
<noembed></noembed>
Thenoembedelementhasbeendeprecatedinfavorof<object></object>.
<s></s>
Theselementhasbeendeprecatedinfavorofstylesheets.
<shadow></shadow>
Theshadowelementhasbeendeprecatedinfavorofstylesheets.
<strike></strike>
Thestrikeelementhasbeendeprecatedinfavorofstylesheets.
<u></u>
Thestrikeelementhasbeendeprecatedinfavorofstylesheets.
Attributes
alink
ThealinkattributedefinesthecolorofanactivelinkontheWebpage.Ithasbeendeprecatedinfavorofstylesheets.
align
Usedtoalignelementsverticallyandhorizontallyonthedocumentpage,thealignattributehasbeendeprecatedinfavorofstylesheets.
background
Thebackgroundattributeisusedtodefineabackgroundimagefortheelement.Ithasbeendeprecatedinfavorofstylesheets.
border
Usedtodefineaborderaroundtheelement,theborderattributehasbeendeprecatedinfavorofstylesheets.
color
Usedtodefinethecoloroftheenclosedtext,thecolorattributehasbeendeprecatedinfavorofstylesheets.
compact
Thecompactattributeisusedinlisttagstocreatealistthattakesuplessspace.Ithasbeendeprecatedinfavorofstylesheets.
face
Usedtodefinethefontfaceoftheenclosedtext,thefaceattributehasbeendeprecatedinfavorofstylesheets.
height
Usedtodefinetheheightoftheelement,theheightattributehasbeendeprecatedinfavorofstylesheets.
language
Thelanguageattributeisusedtodefinethelanguageusedbythescriptelement.Ithasbeendeprecatedinfavorofthetypeattribute.
link
ThelinkattributedefinesthecolorofalinkontheWebpage.Ithasbeendeprecatedinfavorofstylesheets.
name
Thenameattributenamestheelementforusewithdynamiccontent,ithasbeendeprecatedinfavoroftheidattribute.
noshade
Thenoshadeattributeremovesthe3-Deffectfromhorizontalrules.Ithasbeendeprecatedinfavorofstylesheets.
nowrap
Usedtostoptablecontentsfromwrapping,thenowrapattributehasbeendeprecatedinfavorofstylesheets.
size
Usedtodefinethesizeoftheenclosedtext,thesizeattributehasbeendeprecatedinfavorofstylesheets.
start
Thestartattributeoflisttagsdefinesthestartingnumberofthelist.Thisattributehasbeendeprecatedinfavorofstylesheets.
text
ThetextattributedefinesthecolorofthetextontheWebpage.Ithasbeendeprecatedinfavorofstylesheets.
type
Thetypeattributeoflisttagsdefineswhattypeoflistshouldbeused.Thisattributehasbeendeprecatedinfavorofstylesheets.
value
Thevalueattributeoflisttagssetsthevalueofthelistitem.Thisattributehasbeendeprecatedinfavorofstylesheets.
version
TheversionattributedefinestheversionofHTMLusedbythedocument.IthasbeendeprecatedinfavorofDTDs.
vlink
ThevlinkattributedefinesthecolorofavisitedlinkontheWebpage.Ithasbeendeprecatedinfavorofstylesheets.
width
Thewidthattributedefinesthewidthinpixelsoftheelement.Ithasbeendeprecatedinfavorofstylesheets.