Original link: https://hacks.mozilla.org/2016/05/css-coding-techniques/Link: http://www.zcfy.cc/article/css-coding-techniques-x2605-mozilla-hacks-8211-the-web-developer-blog-1244.htmlRecently, I've found that many people are stumped by CSS, both novice and experienced developers. Naturally, they want to have a better language to replace it, and the
IE6 is still the main browser of domestic users, so as the front-end development of Web pages, inevitably must be compatible with IE6 browser, here are 10 use valid HTML and CSS code repair can be compatible with IE6 common problems.
We know IE will still be popular for some time, but can we still support browsers and avoid hacks and conditional CSS? There are 10
CSS in the!important is a very important attribute, and sometimes play a very large role, this knowledge is not very much, we look at the following article, the understanding of its comparative perception.
A few days ago, when I wrote some CSS code, I was embarrassed. Because the damn IE6 support to the CSS is so bad,
Especially in the Microsoft IE6 version open DIV+CSS developed Web page, the browser does not show white space, do not show anything, but view the source code results page code is complete. You are experiencing this problem when you are developing a test page!
Common Web page display blank, Web page source file complete reason is as follows:
1, the main reason
For the same project or a Web page, although eventually every front-end development engineer can achieve the same effect, the code they write must be Different. Some elegant, look clear, the code is extensible, such code is conducive to teamwork and later maintenance, and some confusion, although the ultimate effect, but obscure, obviously the team members in rea
Some CSS properties allow a string of values to be substituted for many properties, with the value separated by a space.
Margin,pdding and Border-width allow merging of Margin-top-width, Margin-right-width, Margin-bottom-width, and so on, in the form of: Property:top Right bottom, counterclockwise order.
So the following code:
p { border-top-width: 1px; border-right-width: 5px; border-bottom-width: 10px;
will not encounter the doomed Divities 1 and Classitis 2 trouble!/*you only need to add in that stuff once your have begun to WR Ite the CSS and realize that you are going to need another hook to accomplish what for you are trying to achieve.*/(not translated in the original). Uses the CSS child selector to specify child elements; Do not simply add a class or ID selector to an element mechanically.
After the previous article "Best Practices for front-end code standards: javascript" was published, we were very enthusiastic about it. It reflected that front-end engineers paid great attention to writing standard front-end code. These best standard practices are not published by the authoritative organization, but are summarized by a large number of front-end engineers in their experience in the practice
The CSS code writing sequence of font and line-height is different, which leads to different display effects. When the font and line-height attributes are applied to the same HTML Tag, you have to be careful. The writing sequence of the two is different, which may lead to different display effects.
That is:
>>> If you write font first and then line-height, the result is normal.
>>> If line-height is first w
CSS is not difficult to learn, but it becomes difficult to manage in large projects. In particular, different people have slightly different CSS writing styles, making it even harder to communicate with teams, to this end, we have summarized some CSS Code principles on how to implement efficient and clean
As a web designer, your site has exactly the same performance in a variety of browsers as the goal of many people, however, this is a goal that can never be truly achieved, and many people think that perfect cross-browser compatibility is not necessary, although it is true, in many cases, an approximate compatibility is easy to implement, This article is about a variety of Cross-browser compatible CSS coding guidelines and techniques.
Understanding
Some CSS attributes allow a string of values to replace many attributes. Values are separated by spaces.Margin, pdding, and border-width can be merged into margin-top-width, margin-right-width, margin-bottom-width, and so on, in the form of property: Top right bottom left; it is in a counter-clockwise order.
So the followingCode:
P {Border-top-width: 1px;
Border-right-width: 5px;
Border-bottom-width: 10px;
Border-left-width: 20px ;}
Can be
= = ' ReadyStateChange ' (document.readystate!== ' interactive ' document.readystate!== ' C Omplete ')) {
Return
}
The order of interaction and completion status in each browser does not guarantee consistency, depending on the browser and the content of the page, adding this judgment document.readystate!== ' interactive ',
It means that no matter which stage comes first, the code can be executed earlier.
Second, on-demand loading
Some CSS attributes allow a string of values to replace many attributes. Values are separated by spaces.Margin, pdding, and border-width can be merged into margin-top-width, margin-right-width, margin-bottom-width, and so on, in the form of property: top right bottom left; it is in a counter-clockwise order.So the following code:P {Border-top-width: 1px;Border-right-width: 5px;Border-bottom-width: 10px;Border-left-width: 20px ;}Can be written:P {Borde
CSS is not difficult to learn, but in large projects, it becomes difficult to manage, especially the different people in the CSS writing style slightly different, the team is more difficult to communicate, to summarize some how to achieve efficient and neat CSS code principles:
1. Use reset but not global reset
The d
CSS is not difficult to learn, but it becomes difficult to manage in large projects. In particular, different people have slightly different CSS writing styles, making it even harder to communicate with teams, to this end, we have summarized some CSS Code principles on how to implement efficient and clean
Earlier we shared the article "How to create wonderful web design using color Filters", with a gradient color filter for many beautiful effects, but what is the gradient color? Can look at today for everyone to share the uigradients gradient to share the site, there are many beautiful choice of options Oh!Uigradients to share the beautiful gradient color-based sharing station, close to hundreds of gradient color schemes, designers can choose to match their own style, in addition, we can also dir
Author: nuysoft/high cloud QQ: 47214707 Email: nuysoft@gmail.comDisclaimer: This article is an original article. If you need to reprint it, please indicate the source and retain the original article link.
Jquery source code analysis series (Continuous updates)
Style Sheet
Overview
How to Use
Usage Details
Implementation Principles of features
Source code analysis
. CSS
The predecessor of Emmet is Zen coding, which uses the syntax of an imitation CSS selector to generate code that greatly improves the speed of html/css code writing.Emmet Official website: http://www.emmet.io/For coding Demo1. InitializeHTML documents need to contain some fixed tags, such as Html:5 or!: for HTML5 docum
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.