Have problems starting with self-learning CSS, "link to external style sheet" in multi-browser display problem

Source: Internet
Author: User

At the beginning of self-learning CSS encountered problems, "linked to the external style sheet" exercise, the code is as follows:
A, the CSS file code that is linked into. css
<style type= "Text/css" >
<!--
H1{background:gray;text-align:center;font-family: Official Script}
H3{background:blue;text-align:center;font-family: Official Script}
P{background:green;text-align:center;font-family: Official Script}
-
</style>
--------------------------------------------------------------------------------
B, HTML exercise page code. html
<meta charset= "UTF-8" >
<title> linking to external style sheets </title>
<link rel= "stylesheet" type= "Text/css" href= "was linked to an external CSS file. css" >
<body>

<p> call an external CSS in an HTML file to apply a link to an external style sheet method. </p>

</body>
-------------------------------------------------------------------------------
There's a lot of problems, I'm one by one.

1, the above A, B code unchanged, directly open with IE, all show normal, I want to have the effect. But with
Chrome and Firefox open, the first element tag (that is, H1 which row) does not have a CSS effect, the next two lines (

That is, H3, p) effect is normal. Why??

2, if the B code

The first line H1 loses the CSS effect, the following two lines are normal). Why?? Why??

3, I use the exercise answer all requirements in <style> </style> in the middle to add <!--xxxx-->, explained that the browser does not recognize CSS, but I see a lot of Web source and not this strange <!--xxxx-- Other CSS books do not have this requirement. So I tried to get rid of it, the result is magical, and appeared with 1, 2 exactly the same problem!!!! Why?? Why?? Why

I completely collapsed ~ ~ ~ to ask the expert guidance, thank you ~ ~ ~

Have problems starting with self-learning CSS, "link to external style sheet" in multi-browser display problem

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.