Expression Studio 4.0

Sets the minimum width for an element.


{ min-width: sMinWidth }

Possible values


Variant that specifies the minimum width for an element:


Floating-point number followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).

For more information about the supported length units, see Length units reference.


Integer followed by a percent sign (%) that specifies a percentage of the containing block height to use as the maximum height of the element. If the height of the containing block is not explicitly set, the element has no maximum height and the max-height property is interpreted as 0%. For more information about containing blocks and how their heights are computed, see the Cascading Style Sheets (CSS), Level 2, Revision 1 (CSS2.1) Ee371243.xtlink_newWindow(en-us,Expression.40).png specification.

The property has no default value. It is not inherited.


The min-width and max-width attributes apply to floating and absolutely positioned block level elements and inline-block elements, and also to some intrinsic controls. They do not apply to non-replaced inline elements, such as table rows and row/column groups. (A "replaced" element has intrinsic dimensions, such as an IMG element or a TEXTAREA element.)

This property is enabled only under the strict !DOCTYPE.


The following example shows how to constrain the width of a DIV element using min-width and max-width attributes. The example can be viewed only with Microsoft Internet Explorer 7 or a later version:

<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Strict//EN">
.width {
.content {
    border :1px solid #c00;
<div class="width">
<div class="content">
        <h2>{min-width:200px; max-width:400px}</h2>
        <p>This div has a width of 50%. Resize the window
         to grow and shrink the div from max to min width.<br/><br/>
         The outer div controls the width of the inner "content" div.
         Note that the div height increases to accomodate the flow of text.</p>

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2) Ee371243.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, abbr, acronym, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, frameset, frame, hn, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, li, object, ol, p, q, s, span, sub, table, td, th, tt, u, ul, var, xmp

See also



Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions