Difference between revisions of "CSS GUIDE WIDTH"

From CDOT Wiki
Jump to: navigation, search
 
(Summary)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
This property is used to set the width of a given element.
 
This property is used to set the width of a given element.
  
Inherited: No
+
* Applies to: all container elements
 +
* Media: visual
 +
* Inherited: no
 +
* Percentages: yes
  
 
== Syntax ==
 
== Syntax ==
Line 15: Line 18:
  
 
== Usage Examples ==
 
== Usage Examples ==
<pre>table{width: 100%}</pre>
+
<pre>table{width: 100%;}</pre>
<pre>img{width: 200px}</pre>
+
<pre>img{width: 200px;}</pre>
<pre>form{width: auto}</pre>
+
<pre>form{width: auto;}</pre>
  
 
== Notes ==
 
== Notes ==
  
 
== Specification Conformance  ==
 
== Specification Conformance  ==
 +
[http://www.w3.org/TR/REC-CSS1#width CSS1]<br />
 +
[http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-width CSS2]<br />
 +
[http://www.w3.org/TR/css3-mediaqueries/#width CSS3]
  
 
== Browser Compatibility ==
 
== Browser Compatibility ==
  
 
== See Also ==
 
== See Also ==
 +
[http://www.w3.org W3.org - Cascading Style Sheets ]<br />
 +
[http://www.w3schools.com/css/pr_dim_width.asp W3Schools]

Latest revision as of 01:13, 12 December 2006

Summary

This property is used to set the width of a given element.

  • Applies to: all container elements
  • Media: visual
  • Inherited: no
  • Percentages: yes

Syntax

TARGET_ELEMENT{width:100%}

Legal Values

% - Value specified as a percentage of the browser window. length - Value specified as a length (i.e. px, cm or in) auto - The browser will calculate and select a width for the specified element.

Mozilla Recommended Values

Usage Examples

table{width: 100%;}
img{width: 200px;}
form{width: auto;}

Notes

Specification Conformance

CSS1
CSS2
CSS3

Browser Compatibility

See Also

W3.org - Cascading Style Sheets
W3Schools