read the code to make easier the future, we should add relevant comments, then open the css.css file, write CSS information, the code is as follows:
Next we create a new folder on the desktop, named
/ * basic information * /
body {font: 12px Tahoma; margin: 0px; text-align: center; background: # FFF;}
After you save the code
text-align: center
text alignment,
tom ford glasses, can be set to left, right, middle, and here I set it to center alignment.
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px
or
margin: 0px 0px 0px 0px
addition to the following wording:
margin: 0px auto;
that the upper and lower margins to 0px, left for the automatic adjustment;
we will use later to the padding and margin properties have many similarities place, their argument is the same,
but their meaning is not that the same, margin is the external distance, while the padding is the internal distance.
This is the basic structure of XHTML will be named index.htm, the other is named Notepad document css.css.
can see the whole page is centered,
birkenstock florida, then what is the reason it makes the page centered?
# container because we used the following attributes:
margin: 0 auto;
as previously noted, we can see that the upper and lower margins to 0, so automatically, so the layer will automatically centered.
home page if you want the left, you can cancel the auto value, because the default is left home display.
via margin: auto so that we can easily layer automatically centered.
order is on the / right / down / left, you can also write to margin: 0 (abbreviation);
style that body part above the lower right of the left margin to 0 pixels, and if it is automatically adjusted using the auto margin,
/ * bottom of the page * /
# Footer {width: 800px; margin: 0 auto; height: 50px; background: # 00FFFF}
margin: 0px;
also use abbreviations,
abercrombie fitch clothes, complete should be:
font: 12px Tahoma;
abbreviations used here, the complete code should be: font-size: 12px; font-family: Tahoma; that is 12 pixels font size, font is Tahoma format;
/ * page level container * /
# container {width: 100%}
4, how to make the page center?
height / width / color
represent the height (px), width (px), font color (HTML color table).
/ * the page header * /
# Header {width: 800px; margin: 0 auto; height: 100px; background: # FFCC99}
background: # FFF
set the background color to white, where color used abbreviations, complete should be background: # FFFFFF.
background layer can be used to fill the specified background color, background image, the future we will use the following format:
background: # ccc url ('bg.gif') top left no-repeat;
said: use # CCC (gray color) fill the entire layer, using bg.gif as a background image,
top left
that picture in the top left of the current level,
buy manolo, no-repeat that display only the image size without fills the entire layer.
top / right / bottom / left / center
used to locate the background image, respectively, on the / right / down / left / middle; You can also use
background: url ('bg.gif') 20px 100px;
said X coordinate is 20 pixels, Y coordinates 100 pixel precise positioning;
repeat / no-repeat / repeat-x / repeat-y
fill the whole layer, respectively, / is not fill / fill along the X axis / Y axis along the fill.
2, body is an HTML element, all the contents of the page should be written in the label on the inside, I will not say more;
1, please note develop good habits, it is very important;
5, here I introduce these commonly used CSS properties, and others see CSS2.0
Chinese manual.
on the above description of CSS (Refer to CSS2.0
Chinese manual, online, download):
/ * Page body * /
# PageBody {width: 800px; margin: 0 auto; height: 400px; background: # CCFF00}
3, to explain some common CSS code means:
[/ color]
[/ color]
Here, we DIV tag on the basic structure is written, the code is as follows:
the above save the file, open the browser, then we can already see the infrastructure, this is the page framework.
other article
peak men 就像他在我们困难时扶持我们一样
电子表格中将数字转换为大写金额
supra muska skytop