Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS max-width definition

Syntax

max-width: <value>;

Description

The max-width property defines the maximum width of an element.

Values

none | <length> | <percentage>

Version information

Available in CSS2

Example

[Try this example yourself]
<style type="text/css">
p.width
{
max-width: 100px
}
</style>

<p class="width">
  This text has a maximum width of 100 pixels.
  This text has a maximum width of 100 pixels.
  This text has a maximum width of 100 pixels.
  This text has a maximum width of 100 pixels.
  This text has a maximum width of 100 pixels.
  This text has a maximum width of 100 pixels.
</p>

Output

This text has a maximum width of 100 pixels. This text has a maximum width of 100 pixels. This text has a maximum width of 100 pixels. This text has a maximum width of 100 pixels. This text has a maximum width of 100 pixels. This text has a maximum width of 100 pixels.

  • Comments

No comments added.