CSS Basic Stuff

Source: Internet
Author: User

0 CSS is also a messy thing, we need in the most appropriate case, write the most messy effect.
1 Face body set-webkit-font-smoothing:antialiased (the default is subpixel-antialiased), in the black and thick large text can also be seen in front of, but to a small group of posts everywhere there is fast blind,
2 Floating and absolute positioning good phase, not recommended to use
3 4 Window.addeventlistener (' Load ', function () {
Fastclick.attach (document.body);
}, False); Move the domain in order to prevent a delay of 300 milliseconds.
5 margin:0 Auto; Two reasons for failure, one is because the DIV has no width and the other is because, fixed. This time can only pass.
6 about absolute positioning and relative positioning. The fixed default is absolute positioning, and margin:0 auto fails at this time.
Absolute and relative positioning relative to the nearest parent element.
If an absolute and relative does not set top and left, then there is no need to consider his parent class in order that he may be someone else's parent.
Absolute positioning does not occupy space. If all is absolute, look at the hierarchy. At the same level, look at the events that appear, and who looks after them.
The display property of the default img in 7.css is inline and only a few of the body, Div, p, H1, etc. have block definitions.
If you need an IMG with a block attribute, you also need to define it in the CSS
img {display:block;}
8. The Div1 hierarchy is 1,div1 inside the div2 even if the hierarchy is 4, and the div1 level of the same DIV2 level 3, then div2 can not cover div1.
9. When you define a CSS with a position attribute value of absolute, relative, or fixed, use Z-index this value in order to take effect. The larger the value of this attribute parameter, the label is stacked on top.
10.font:12px/20px font-size/line-height Specifies font size and line height
font:12px/20px "\5fae\8f6f\96c5\9ed1", Arial,sans-serif;
11.text-decoration Properties of text decorations
None defaults. Defines the standard text.
Underline defines a line below the text.
Overline defines a line on the text.
The Line-through defines a line that passes through the text.
Blink defines the blinking text.
Inherit specifies that the value of the Text-decoration property should be inherited from the parent element.
12.outline this style.
13. Many times do not need 100%, because we resize set the width of broadband on the line. But inside content may burst, so will use MinWidth, norm.
The center of the H tag can be used text-align:center;
<a href= "#" > Business School <span>business school</span></a> This form is a jump text, and there is a question that does not jump below. A display:block is usually given to the span below, and it becomes two lines.
16.text-decoration:none; Remove the slip line of a label.
<a> Jiangsu Huai </a> usually in the same row as the pictures in Jiangsu Huai state and behind.
18.<li> Qingxin Director: </li>
<li class= "Last" > Phone:400-009-6359</li> below the text center can be used completely, text-align;
The 19.SCROLLTOP represents the height of the scroll bar in the past.
The Text-indent attribute specifies the indentation of the first line of text in a block of texts.
line-height:50px the text has the same height as the outside, and the text has a center effect.
22.
Background:url (.. /images/list01.png) no-repeat 0 Center;
The image address is not repeated horizontal position 0 Vertical Position Center
0 Center means horizontal position 0 Vertical Position Center
This means that the picture is in the position of the Div, and the extra is not displayed. The size of the picture is not considered.
The magical method of stop. How many bugs and code volumes are reduced.
$ ("#flQQ ul li"). EQ (2). Hover (function () {
$ (this). Find (". Tel"). Stop (). Animate ({width: "160px"},500);
},function () {
$ (this). Find (". Tel"). Stop (). Animate ({width: "0px"},500);
});
24. Add Parabolic:
var flyer = $ (" ');
Flyer.fly ({
start:{
Left:event.clientX,//Get the X, y coordinates of the Click shopping Cart button
Top:event.clientY
},
end:{
Left:offset.left,
Top:offset.top,
WIDTH:20,
Height:20
},
Onend:function () {
Flyer.fadeout ("Slow", function () {
$ (this). Remove (); //
});
}
25. Replace icon with font
Http://www.jb51.net/css/70033.html
. $ (". Top div"). EQ (index). Show (. Siblings (). Hide ();
27.$ (This). Find (". Hover"). Slidetoggle (1000);
$ (this). Siblings (). Removeclass ("select"). Find (". Hover"). Slideup (1000);
Slidetoggle Slidedown Slideup
@font-face custom fonts, IE also supports very well.
Http://www.w3cplus.com/content/css3-font-face
29.
There are two types of styles introduced from the outside: (note written in the head tag) Link style sheet: <link rel= "stylesheet" type= "Text/css" href= "My.css" (href for path) > HTML: <style type= "text/css" > @import url ("css.css");></style>
30. Customize the list to start with the <dl> tab; Each custom list item starts with <dt>; the definition of each custom list item starts with <dd>. (Paragraphs, line breaks, pictures, links, and other lists can be used inside list items that define lists)
31.this.auto = a? A:false;
White-space:nowrap, Chinese mandatory no Line 33. $ ("Span:eq (0)"). Text ("" + $ ("div"). Data ("Test1")); Notice how this selector is selected.

33. Those attributes can be inherited, margin:0 auto; The precedence of inherited properties is highest or lowest.
Width can inherit, or can only support the big.
=======================================
Something that should be remembered at some point
34.<link href= ' my.css ' rel= ' stylesheet ' type= ' text/css '/>
35. Three ways to clear the float.
http://blog.jobbole.com/49173/.
http://blog.dimpurr.com/css-before-after/
Http://www.zhangxinxu.com/wordpress/2010/09/after%E4%BC%AA%E7%B1%BBcontent%E5%86%85%E5%AE%B9%E7%94%9F%E6%88%90 %e5%b8%b8%e8%a7%81%e5%ba%94%e7%94%a8%e4%b8%be%e4%be%8b/

CSS Basic Stuff

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.