CSS - Sizes

em size

this is the font size 1em - 16px
this is the font size 2em - 32px
this is the font size 3em - 48px

box1


.box1 {
    background: orange;
    width: 200px;
    height: 100px;
    color: white;
}
width is fixxed

box2


.box2 {
    background: green;
    width: 50%;
    height: 200px;
    color: white;
}   
width is 50% of the windows width

box3 and box4


width is fixxed with display: inline-block
width is 50% of the windows width with display: inline-block and without crlf between the boxes

.box3 {
    background: orange;
    width: 200px;
    height: 100px;
    color: white;
    display: inline-block;
}
.box4 {
    background: green;
    width: 50%;
    height: 200px;
    color: white;
    display: inline-block;
}   
width is fixxed with display: inline-block
width is 50% of the windows width with display: inline-block and without crlf between the boxes

box 5 and box6


floating right, although first in code
floating left, although second in code

.box5 {
    background: orange;
    width: 200px;
    height: 100px;
    color: white;
    float: right;
}
.box6 {
    background: green;
    width: 50%;
    height: 200px;
    color: white;
    float: left;
}   
floating right, although first in code
floating left, although second in code










back to main page