Let's talk about the difference between a CSS

Source: Internet
Author: User
I have time to read the basic CSS tutorial today. (I saw a lot of people think they know a lot about it, and they immediately read maseter CSS. Why can't I read a lot of it ?, The background is too thin, so I still have a good foundation .)
See an example:

1 < Html Xmlns = "Http://www.w3.org/1999/xhtml" XML: Lang = "En" Lang = "En" >
2 < Head >
3 < Title > Text Test </ Title >
4 < Link Type = "Text/CSS" Href = "Css2.css" Media = "Screen" REL = "Stylesheet" />
5 </ Head >
6 < Body >
7 < Div ID = "Container" >
8 This is a test. I did deletests recently! And it's very good !!!
9 </ Div >
10
11 </ Body >
12 </ Html >
13

CSS:

1 /**/ /*Body*/
2 Body
3 {} {
4 Background-color : White ; /**/ /*Not all are white backgrounds*/
5 Margin : 10px ;
6 Border : 1px solid #000 ;
7 Padding : 10px ;
8 Font-family : Arial ;
9 Font-size : 16px ;
10 /**/ /*Font-weight: 600;
11
12Font-style: italic;*/
13
14 Line-height : 2 ;   /**/ /*It is twice the font-size.*/  
15 }
16
17 # Container
18 {} {
19 Width : 400px ;
20 /**/ /*
21Margin-top: 20px;
22Margin-left: 200px;
23Margin-bottom: 5em;
24/* Margin-Right: 400px;*/
25 Border : 1px solid #000 ;
26 Padding : 20px ;
27 Background : # Ccc ;
28 Margin : 10px auto 10px auto ;
29
30 }

The following information is displayed in IE 6.0:


The following information is displayed in Firefox 2.0:

Where does the border come from? (I don't know)
In addition, ie is not centered, while FF is centered (FF is said to be more standard ).
Gradually, we will find that there are many differences between IE and other browsers. Similarly, there are many situations in Javascript that require attention to different browsers (wait for time to collect them ). Why do not they follow the standard? How much energy does it take.
Consider not onlyProgramFor implementation problems, developers and designers also need to consider the different effects of different browsers, because the first thing users see is the actual effect (Here we only talk about B/S ). Consider (x) HTML, CSS, and Javascript in different browsers.
However, it seems that this situation is not particularly prominent in China, because everyone's design is generally based on MS's IE, with more than 90% domestic users (I am referring to ordinary users, excluding developers) all use IE, even if it is not used IE is also used ie kernel, in fact, are the same.
So there is no special concern about website standardization.
For example:
Our company is developed based on MS. net, so we certainly recommend that you use IE, and we are all internal systems used by the Development Company, not for external users, so few people find browser compatibility problems.
But if you look at it with FF or other browsers, it is simply unsightly (Note: basically all are in the table layout), it is useless. All la s are misplaced.

There may be many people who simply think that IE is a standard, so it is good to test it with IE directly. Alas, no wonder, do you spend more than 10% of your energy and effort (which is also considered by more people) for about 40% of users )?
I don't think it will take a long time for standardization to become a hot topic...

Here I want to recommend a person's blog. I have learned a lot from it:
Http://www.cnblogs.com/JustinYoung/

Related Article

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.