This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Anurag_001
almost 10 years

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

Permalink

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>
points
over 9 years