What Color is Your Background?
The joy of CSS. Here we are using font sizes, margins, floats, and line height to position the text exactly where we want it. The browsers don't handle the code exactly the same but one style will suit some while the other style will suit others.
In this playful HTML CSS journey we are explicitly telling the browser the width and height for better control.
For the number 20 we are telling the browser where we want the top margin and the line-height for this font size.
width:375px;height:475px;
The defined width is 375 pixels wide. We are suggesting to the browser that we would like to limit the width to 375 pixels wide. We had to fiddle with it to get the width just right. IE automatically stretches wide enough to display the content but the best practice might be to specify the width.
We have to tell Mozilla Firefox the
height so we put in height:475px;.
Mozilla wants explicit directions.
In IE the height doesn't have to be defined.
It will stretch to fit.
background:transparent;
We used background:black;. If we change that to background:transparent; then our natural background
color will show through.
Using the Color Name
We can change the background to any color name that the browser recognizes. We use named colors that browsers recognize including white, pink, yellow, lemonchiffon, yellowgreen, ivory, hotpink, and lightseagreen. It's easier to adjust the color name than the hex or RGB color.
Copy and paste this in your Blog or Web page.
It will look like this.
The joy of CSS. Here we are using font sizes, margins, floats, and line height to position the text exactly where we want it. The browsers don't handle the code exactly the same but one style will suit some while the other style will suit others.
