Reputation:
I have this HTML code as an example:
<body>
<div class="jumbotron">
<h1>Bootstrap Example</h1>
<p>Just another crazy blog</p>
</div>
<div class="container">
<p>This is some text.</p>
<p>This is another text.</p>
</div>
I am trying to style the jumbotron using this code:
.jumbotron h1, p{
color: #FAE3F2;
font-family: 'Orbitron', sans-serif;
}
The problem is that when I apply these changes, they also affect the paragraph inside the container and I can't understand why. What am I doing wrong?
Upvotes: 1
Views: 406
Reputation: 3698
Try this
.jumbotron h1, .jumbotron p{
color: #FAE3F2;
font-family: 'Orbitron', sans-serif;
}
The ,
separates whole expressions, so .jumbotron
doesn't carry over to the second one.
Upvotes: 1
Reputation: 254
Replace the selectors with this one:
.jumbotron h1, .jumbotron p {...}
Having your selector without .jumbotron p {..}
means that all the p
elements will be selected.
Upvotes: 0