A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.
To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).
Presentational elements and attributes: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
This page is intended to give advice about specific CSS features that can be used instead of each such element or attribute. | This page is intended to give advice about specific CSS features that can be used instead of each such element or attribute. | ||
You should think about whether there is a semantic element that matches the intent of your use of a presentational element. If there is such an element, you should use it, and if it doesn't already have a default styling that you like, then you can use CSS from the tables below to make it look like you want. | |||
== Presentational elements == | == Presentational elements == | ||
{| | {| | ||
|- | |- | ||
!Element | !Element | ||
Line 11: | Line 13: | ||
|- | |- | ||
|basefont | |basefont | ||
| | |'font-size', 'font-family' and 'color' on body | ||
|- | |- | ||
|big | |big | ||
| | |'font-size:larger' | ||
|- | |- | ||
|blink | |blink | ||
| | |'text-decoration:blink' | ||
|- | |- | ||
|center | |center | ||
| | |'text-align:center' and 'margin-left:auto; margin-right:auto' on descendant blocks | ||
|- | |- | ||
|font | |font | ||
| | |'font-size', 'font-family' and 'color' | ||
|- | |- | ||
|marquee | |marquee | ||
| | |CSS transitions and animations | ||
|- | |- | ||
|s | |s | ||
| | |'text-decoration:line-through' | ||
|- | |- | ||
|spacer | |spacer | ||
| | |'margin', 'padding' | ||
|- | |- | ||
|strike | |strike | ||
| | |'text-decoration:line-through' | ||
|- | |- | ||
|tt | |tt | ||
| | |'font-family:monospace' | ||
|- | |- | ||
|u | |u | ||
| | |'text-decoration:undefline' | ||
|- | |- | ||
|} | |} | ||
Line 47: | Line 49: | ||
== Presentational attributes == | == Presentational attributes == | ||
{| | {| | ||
|- | |- | ||
!Attribute | !Attribute |
Revision as of 21:01, 24 June 2009
The HTML 5 spec lists some obsolete elements and attributes, some of which the advice given is "Use CSS instead.".
This page is intended to give advice about specific CSS features that can be used instead of each such element or attribute.
You should think about whether there is a semantic element that matches the intent of your use of a presentational element. If there is such an element, you should use it, and if it doesn't already have a default styling that you like, then you can use CSS from the tables below to make it look like you want.
Presentational elements
Element | CSS feature |
---|---|
basefont | 'font-size', 'font-family' and 'color' on body |
big | 'font-size:larger' |
blink | 'text-decoration:blink' |
center | 'text-align:center' and 'margin-left:auto; margin-right:auto' on descendant blocks |
font | 'font-size', 'font-family' and 'color' |
marquee | CSS transitions and animations |
s | 'text-decoration:line-through' |
spacer | 'margin', 'padding' |
strike | 'text-decoration:line-through' |
tt | 'font-family:monospace' |
u | 'text-decoration:undefline' |
Presentational attributes
Attribute | CSS feature |
---|---|
alink on body elements | |
background on body elements | |
bgcolor on body elements | |
link on body elements | |
text on body elements | |
vlink on body elements | |
clear on br elements | |
align on caption elements | |
align on col elements | |
ch on col elements | |
chOff on col elements | |
valign on col elements | |
width on col elements | |
align on div elements | |
compact on dl elements | |
align on hr elements | |
noshade on hr elements | |
size on hr elements | |
width on hr elements | |
align on h1—h6 elements | |
align on iframe elements | |
frameborder on iframe elements | |
marginheight on iframe elements | |
marginwidth on iframe elements | |
scrolling on iframe elements | |
align on input elements | |
align on img elements | |
border on img elements | |
hspace on img elements | |
vspace on img elements | |
align on legend elements | |
type on li elements | |
compact on menu elements | |
align on object elements | |
border on object elements | |
hspace on object elements | |
vspace on object elements | |
compact on ol elements | |
type on ol elements | |
align on p elements | |
width on pre elements | |
align on table elements | |
bgcolor on table elements | |
border on table elements | |
cellpadding on table elements | |
cellspacing on table elements | |
frame on table elements | |
rules on table elements | |
width on table elements | |
align on tbody, thead, and tfoot elements | |
ch on tbody, thead, and tfoot elements | |
chOff on tbody, thead, and tfoot elements | |
valign on tbody, thead, and tfoot elements | |
align on td and th elements | |
bgColor on td and th elements | |
ch on td and th elements | |
chOff on td and th elements | |
height on td and th elements | |
noWrap on td and th elements | |
vAlign on td and th elements | |
width on td and th elements | |
align on tr elements | |
bgcolor on tr elements | |
ch on tr elements | |
chOff on tr elements | |
valign on tr elements | |
compact on ul elements | |
type on ul elements |