Web Front-End optimization best practices the forth part is oriented to CSS. A total of 6 rules of practice are currently in line. See also the Mozilla Developer Center article: writing efficient CSS
1. Place CSS on top of code page (put
Css
Final effect:
May 30, 2005 News title
May 30, 2005 News title
May 30, 2005 News title
May 30, 2005 News title
CSS code:
. list{ margin:0px 10px 20px; Text-align:left; } . list ul{ list-style-type:none;
Article Introduction: CSS page layout is misplaced.
Why Calculate widthThe pixel width of the page is calculated to make the CSS page layout neat and compatible. We are familiar with the layout of the structure of the page or use padding,
The following is the program code
In this section we discuss how to use CSS to control the surrounding spaces and the setting of the border
Elements surrounding the space margin properties margin can be used to determine the surrounding space, if
Like what:
. c1.c2
{
Text-decoration:underline;
}
In the selector. C1 and. C2 directly together, no space in the middle, no commas, what does that mean? Look at an example:
This is Red
This is Italic
Here are red, italic, underline
The
Hello, I am float, welcome to visit the CSS family, in the CSS family, in today's CSS typesetting popular era, I can play an important role oh. Because my job is very useful to web designers, just as important as the previous align help you locate
Article Introduction: CSS pseudo element before, after magical: the production of fashion focus picture frame
In CSS tags have such a label div:before, Div:after, for before, after the part of the people are quite unfamiliar, then these
CSS implementation of the page in the text typesetting several ways! If you can use it directly with the ready-made!
1. Text inverted (counterclockwise turn 90 degrees) All Personnel Shun Destiny 2. Text is writing vertical row, Chinese vertical
Absolute centered Layer Div+css code example
Here's the code:nice and free CSS Template 11centeredThis area should is horizontally and vertically centered.This text stays left alignedie mac doesn ' t like this! more nice and free CSS
DIV+CSS Example of adaptive width
Here's the code:nice and free CSS Template 10centerThis BOX ist centered and adjusts itself to the browser window.The height ajusts itself to the content.more nice and free CSS templatesBody {Background-
"Lightbox" is a chic and easy-to-use picture display that allows a picture to be rendered directly above the current page without having to go to a new window. Lightbox effect on the network has a lot of JS version of the introduction. But all
Article Introduction: my focus on JS and CSS is also how to download pictures faster. The picture is visually visible to the user. They don't focus on JS or CSS. Indeed, JS and CSS will affect the display of the content of the picture, especially
Css|web|web Standard
With the influence of friends Dodo and colleagues, start paying attention to web standards. Weeks 6th in accordance with the standard Dearbook several pages, summed up some of the experience as follows, for future reference:
Many large domestic portal sites have adopted DIV+CSS production methods, from the actual application of the situation, this method is absolutely better than the form of the method of making pages.Today, most of the Web site still uses the form of
Article Introduction: and when the number or the English language with Chinese characters, will be changed from the Chinese characters, and the pure Chinese characters can be automatically wrapped. How to solve this problem? First come to know the
From top to bottombody{FILTER:progid:DXImageTransform.Microsoft.Gradient (gradienttype=0,startcolorstr= #ffffff, endcolorstr= #000000);Two, from top left to right down gradientbody{Filter:alpha (style=1,opacity=25,finishopacity=100,startx=50,finishx=
Article Introduction: CSS Sets the method by which the IMG changes automatically with the div width.
Description: Because the screen resolution is different, to realize that a layer in the browser changes with the height of the browser
Core tips: Calling network font resources in CSS Google font API
Google published a few days ago at the Google I/O conference on a new service font API, this is a cool thing, can make it easy to use web fonts, and these fonts are free, you do not
Core tips: CSS background positioning background-position Negative has been difficult to understand the difficulties, on the one hand with less, on the other hand, the understanding of the lack of depth, today took a little time to seriously think
Here is a list of commonly used examples, not for research purposes, and for each box, there are no attributes such as Margin,padding,boeder.
single row One column The following is a reference fragment:body {margin:0px; padding:0px;
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