Skip to: content, navigation

by Ian Lloyd

size (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Depr. Version
Yes N/A
size="number"

Example

This code places a ten-pixel-high red horizontal rule after the paragraph:

<p>And with that the actress and the bishop apologized for being 
    a real-life, walking-cliché ending to a non-existent joke.</p>
<hr color="red" size="10"/>
<div id="footer">&copy; All content copyright 2008. Even the 
    unfunny stuff.</div>

Figure 1 shows a rule that’s 30 pixels high.

Figure 1. A 30-pixel horizontal line HR with size attribute

Description

The size attribute determines the hr element’s height in pixels.

Value

This attribute takes as its value a number wrapped in quotes (which is understood and rendered as pixels on screen—there’s no need to specify unit of measurement, as we saw in the example above).

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full

The size attribute is well supported, but as a deprecated (presentational) attribute, it should not be used.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters