The code is as follows:
Male
Female
In this way, the div inside Div is evenly distributed by drifting the inner div to the left and then setting the width to a slightly less than average (to prevent extrusion).PS, use this method to center
The habit of writing CSS to determine the speed of page rendering, this point in the brain residual ie more obvious. Develop good habits, and even the formation of norms, will make your page faster loading, the user experience is higher, the
1, the CSS Control div can not center the most easily committed also the simplest is not to write a DTD statement, does not conform to the rules of the web, this is easy to solve, at the top of the page plus:
That's it! In fact, there are a lot of
Wrapping lines for plain text paragraphs
Case Description: In practical applications we often encounter such a problem, is a paragraph of text, with a clear width, the need for text to automatically wrap. (pictured below)
Case study:
Background-position:url (picture) horizontal (X) Vertical (Y)
If the horizontal (X) is a positive number, vertical (Y) is a negative number, indicating that the top right corner of the picture is the coordinates, moving each displacement, such as 8-
In the view of Tencent, Sina, the layout of these large sites, found a problem, why they will put the CSS directly on the page, rather than separate as a CSS file link in.
This is a kind of optimization scheme to deal with super large flow.
To
Before using the CSS sprites often encountered a problem, if you need to repeat the background of the situation how to solve?
The general solution is: if it is horizontal, the picture set to banner, you can repeat-x. Take the method of no
CSS 3 types of positioning methods to control the layout of the page: general positioning, floating positioning, absolute positioning.By default, normal streaming technology is used to layout elements in the page, hoping to behave differently than
Paragraph indentation is very practical, with the P tag can play an unexpected effect. The paragraph indent definition in CSS is implemented by text-indent, below its parameters and usage:
Syntax: Text-indent:〈 value
Allowable value: Length or
CSS Layout Common methods Float:none|left|right Value: None: Default value. object does not float left: Text flows to the right of the object Right: Text flows to the left side of the object How it works, look at a row and two columns of
I write the page is wrapped in a div called #container, so here is mainly about the relationship between body and #container.First look at the body's CSS style:body{Margin:0;padding:0;text-align:center;}Here the body put margin and padding set to 0,
One-line column Body{margin:0px;padding:0px;text-align:center;} #content {margin-left:auto;margin-right:auto;width:400px;width:370px} two rows and one column Body{margin:0px;padding:0px;text-align:center;}
Snook.ca recently gave all Csser some "top tips" when it comes to writing CSS.
Font size using px
Declare CSS within a single line
Compare the following two:
H2 {font-size:18px border:1px solid blue; color: #000; Background-color: #FFF;}
H2 {
There are three types of CSS selectors. ① contextual selectors; ②id and class selectors; ③ property selectors, and the biggest benefit of contextual selectors is that it's convenient to add styles based on location for HTML elementsFor example, we
Move the background image to the left and use the background positioning properties more familiar friends should be easy to do, here is a good example, not friends can refer to the
The upper-left corner of the background picture is relative to the
In order to make all browser fonts unified, you need to load the remote font through the CSS, there is a good example, we can refer to, I hope to help you
Copy Code code as follows:
*china*Results
The following techniques are believed to be more practical, so that a line of text always appear at the bottom of a Div, do front-end development, certainly what the situation will be encountered, although this is not commonly used, but also will be
JS and CSS so that each refresh page to create a random background map, of course, my answer is OK, the following is the specific realization of ideas, interested friends can refer to the followingToday, a friend on the Weibo asked me if you can use
Some CSS properties about line wrapping, cropping
Word-wrap:normal | Break-word
Normal line wrap, content can burst containers, such as long words or long numbers of casesBreak-word the word as the line, and if necessary, the words inside the word
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