1/* <length> values */
2width: 300px;
3width: 25em;
4
5/* <percentage> value */
6width: 75%;
7
8/* Keyword values */
9width: max-content;
10width: min-content;
11width: fit-content(20em);
12width: auto;
13
14/* Global values */
15width: inherit;
16width: initial;
17width: unset;
1#myID {
2 height: 100px; /* Sets the height */
3 width: 200px; /* Sets the width */
4}
5/* or... */
6.myClass {
7 height: 220px; /* Sets the height */
8 width: 40px; /* Sets the width */
9}
10/* They both work! */
1html {
2 position: relative;
3 min-width: 1024px;
4 min-height: 768px;
5 height: 100%;
6}
7<!-- Remove height 100% if needed fixed height -->
1/* <length> values */
2width: 300px;
3width: 25em;
4
5/* <percentage> value */
6width: 75%;
7
8/* Keyword values */
9width: max-content;
10width: min-content;
11width: fit-content(20em);
12width: auto;
13
14/* Global values */
15width: inherit;
16width: initial;
17width: unset;
18
1The width property in CSS specifies the width of the element's content area. This “content” area is the portion inside the padding, border, and margin of an element (the box model).