Getting started with Div + CSS layout (3) -- creating a page at the top

Source: Internet
Author: User

3. Create at the top of the page (1)
After we have written the DIV structure of the page, we can start to carefully create each part.
In the article, we wrote some examples for the preview structure. We cleared all the styles in css.css and re-written the following style code:
Program code
/* Basic information */
Body {font: 12px Tahoma; margin: 0px; text-align: center; background: # FFF ;}
A: link, a: visited {font-size: 12px; text-decoration: none ;}
A: hover {}
/* Page-layer container */
# Container {width: 800px; margin: 10px auto}
Style description:
A: link, a: visited {font-size: 12px; text-decoration: none ;}
A: hover {}
These two items are the super link style on the control page, which is not described here. Please refer to the manual.
# Container {width: 800px; margin: 10px auto}
Specify the display area of the entire page.
Width: 800 px specifies the width of pixels, which is set as needed.
Margin: 10px auto, the top and bottom margins of the page are 10 pixels and displayed in the center.
As we mentioned in the previous chapter, setting the left and right margins of the layer's margin attribute to auto can Center the layer.
Next, let's start to make the TOP part. The TOP part includes the LOGO, menu, and Banner. The first thing we need to do is to slice the designed Image. Below is the slice completed under FW:
I slice the TOP part into two parts. The first part includes the LOGO and a horizontal line. The image width is PX.
Here, some friends will say, * why should we use the GIF format? Isn't it better to use JPEG?
Because the image files in GIF format are smaller, the page loading speed is faster. Before using this format, you must make sure that the image does not use too many colors. When we use the GIF format, it is feasible to see that the image changes too much from the naked eye.
* Can the next Banner still use the GIF format?
.
* Reasonable slicing is very important because the correct slicing method determines the simplicity of CSS Writing and the page loading speed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.