You don’t necessarily need different id’s, can do using same classes, see:
.jumbotron.success {
background-color: #4CAF50;
}
.jumbotron.warning {
background-color: #FF9800;
}
.jumbotron.danger {
background-color: #F44336;
}
.jumbotron#beach {
background-color: transparent;
background: url(beach.jpg) no-repeat;
color: #fff;
}
The selector .jumbotron.nome-da-classe
specifies an element that has the two classes, you can do the same with a id
: .jumbotron#id
, the use gets like this:
<!-- Exemplo com classe -->
<div class="jumbotron danger">
<h1>Hello, world!</h1>
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
<!-- Exemplo com ID -->
<div class="jumbotron" id="beach">
<h1>Hello, world!</h1>
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
if they are on different pages, you can even instantiate based on the page ids if they have an id, #index .jumbotron... The fact that he is more specific will override the others. Another alternative is to have a class for each Jumbotron ex: class="Jumbotron first"" and in css . first change the image for each class.
– Michel Simões
Michel, thank you so much for the tip! Solved.
– Angelo Scali