Skip to: content, navigation

by Ian Lloyd

compact (HTML attribute)

Browser support full matrix
IE7 FF2 Saf3 Op9.2
None None None None
Spec
Depr. Version
Yes HTML 2
compact="compact"

Example

Here’s compact applied to the navigation block we saw earlier:

<ul compact="compact">
  <li><a href="/">Home</a></li>
  <li><a href="/about/">About Us</a></li>
  <li><a href="/portfolio/">Portfolio</a></li>
  <li><a href="/clients/">Clients</a></li>
  <li><a href="/contact/">Contact Us</a></li>
</ul>

Description

The compact attribute’s purpose is to instruct the browser to render the unordered list into a smaller text block by reducing the spacing between lines and/or reducing the default indentation.

This attribute is now deprecated, and is highly presentational in its nature. The desired visual effects can all be achieved with CSS and, as such, this attribute shouldn’t be used—it’s presented here for informational purposes only.

Value

The only acceptable value for this attribute is "compact".

Compatibility

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

This attribute has very poor support (that is, not a single browser responded to the compact attribute), but given that it’s a deprecated attribute and the desired effects can be achieved using CSS, this shouldn’t cause any problems.

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