+ 2
EXTERNAL CSS
Using a Window desktop and also a normal Notepad, I created two files, one of the .html extension and the other .css extension, in the same directory, but the point is, using the LINK element, to refer to the CSS, file doesn’t seem to work, but it does very well on the Code playground, it doesn’t work some where else, could I get some form of explanations.
5 odpowiedzi
+ 2
Your css declaration target nothing ^^
The css selector '#intro .first em' search for an <em> element, child of any element with class 'first' and itself child of an element with id 'intro', such as this html code:
<div id="intro">
<span class="first">
<em>this is a sample text content</em>
</span>
</div>
Even in code playground context your actual codes will not style anything ;P
0
Please add the code, there may be something wrong in it
0
And here is the css code
#intro .first em {
color: pink;
background-color:gray;
}
- 2
<head>
<link rel="stylesheet" href="example.css">
</head>
<body>
<p>This is my first paragraph.</p>
<p>This is my second paragraph. </p>
<p>This is my third paragraph. </p>
</body>
This is the html code
- 3
Zaz z★!★<,,?,¿