This forum is now read-only. Please use our new forums! Go to forums
banner
Close banner
Is there something wrong in the code on 9/23?
Why is it that only the first line of the unordered list is visible on the result tab and not the following lines? I am able to rectify this though by removing the class attributes in the
tags of both the lines. Can someone please explain this?
Answer 53e156128c1ccc6a0a000d8f
1 vote
I cannot explain your predicament without seeing your code, so here’s what I have if you wish to compare/cross-reference:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Ultimate Text Challenge</title>
</head>
<body>
<p id="intro">Cascading with CSS</p>
<div>
<p>When you set a property of a selector like 'p' to a certain value, that value applies to <em>all</em> p tags.
If, however, you change that same property to a different value for a more specific instance of p,
that change will <em>override</em> the 'general rule'.
</p>
<ul>
<li><p>If you say p { font-family: Garamond}, all 'p's will have the font Garamond.</p></li>
<li><p class="list_item">BUT if you say li p {font-family: Verdana}, 'p's outside of 'li's will be
in Garamond, and 'p's INSIDE 'li's will be in Verdana.
</p></li>
<li><p class="list_item">The more specific your selectors are, the higher importance CSS gives to the styling you apply!</p></li>
</ul>
</div>
<p id="summary">Greater specificity makes CSS prioritize that particular styling.</p>
</body>
</html>
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency