HTML+CSS Note--1

Source: Internet
Author: User

(Some notes at the beginning of contact with HTML+CSS)

1, the parent box of the high can not give, let the contents of the inside brace up good.

2, for the margin merger problem, the solution is Overflow:hidden, or another border can be added down.

3, for the website logo, we have to set the keyword, written in a element,

1 . Logo a{2        display:block; 3         height:40px; 4         Text-indent: -2000em; /* The first line indent em is the size of a word, REM is the size of a root the word is for the search engine to see */ 5     }

4, we can put CSS styles with the same characteristics in common.css, reducing the code abbreviation.

5.

1 . Register{2 width:49px;3 Height:30px;4 Background-color:#ff6400;5 float: Left;6 text-align:Center;7 Line-height:30px;8 Color: White;9         /*The element adds a float to the inline fast element,*/Ten         /*Display:inline-block;*/ One         /*to the fast element in the line, there is a size, but the position is not accurate, so we use the float*/ A}

7, write style when try to use class, less with ID because the weight of the ID is too high, later write is the right time not to mention

Name chass= "Stie-nav"
id = "Stie_nav"

Alleys, visible area: 1200px;

8, floating: either floating, or not a box has three sub-boxes, there is a floating, the rest will be.

9. Logo optimization

1 <Divclass= "logo">2     <H1>writing H1 is for the right to raise3         <ahref= "/http">Run it, Cloud class</a>4     </H1>    5 </Div>

10, small icon on the webpage

The web site where the bug is able to place png icon images;
16*16

On the top of "/head", this picture is usually placed in the root directory.
Http://www.bitbug.net/favicon.ico can enter this address directly in the URL to find the icon on the Web page

Insert inside the head

<rel= "shortcut icon"  href/>

can be displayed

11, the Nav part,

Why is the navigation bar usually done with Li instead of a direct??
The core reason is to optimize, because a is very important keyword , if all the very important keywords are stacked together, the search engine will think is cheating (easier to search), we use Li separated,

Do not give Li width, because the number of words in each list is not the same, give the width will not look good, so we have to give a padding value, so that you can achieve different lists have the same interval, the middle of the vertical line can be set with Border-right, the last one to be removed namely:

1 . Nav li:last-child {2    border: 0;  /* the border of the last item to hide */ 3 }

12, a span EM B UI IMS is inline element, is not width and height, box width =a+b+c;

13, the current computer resolution is generally less than 2000px;

14, the positioning of elements,

/* The position of the formula: the son of the absolute father, that is, the father: relative;zi:absolute;*/

15. for boxes with padding, the width of the box will be added and reduced .

16, a box to center the display of a method

. Circle{Padding-left:11px;width:100px;/*, have paddingd to learn to add and subtract width*/Height:28px;Background-color:Blue;position:Absolute;Bottom:12px;Overflow:Hidden; Left:50%;/*first go outside fast 50%;*/Margin-left:-55px;/*And then go back to half your size so you can pinpoint it.*/background:Rgba (0,0,0,.3);/*CSS3 Transparent background, does not affect the contents of the box*/Border-radius:15px;/*Fillet radius*/}

17, positioning: 1.1 margin:0 auto; Can only let the standard flow of the box center alignment, must be block-level elements, but also the width, add the positioning of the box want to center alignment, only positioning;

18, the method of clearing floating:

Clear:both;                Overflow:hidden; The following method is better, without additional tags, using pseudo-classes to clear the float. Clearfix:after{content:".";       "." Can be put on display:Block;Height:0;Visibility:Hidden;Clear:both; }This is the balance of IE6; . Clearfix{Zoom:1; }Sina NetEase Another kind of better than the last one. Clearfix:before,clearfix:after{Display:Table;content:"";Line-height:0; }. Clearfix:after{Clear:both; }This is the balance of IE6; . Clearfix{Zoom:1; }<div class= "Father Clearfix" > Xiaomi website * *

HTML+CSS Note--1

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.