I have been trying to add background image to a div class using CSS, but I didn\'t have any success.
HTML code:
You can try this also for setting the class in a div section:
/** CSS **/
.content {
background: url('http://www.gransebryan.com/wp-content/uploads/2016/03/bryan-ganzon-granse-who.png') center no-repeat;
}
.displaybg {
text-align: center;
color: #FFF;
}
<div class="content">
<p class="displaybg">This is just a test</p>
</div>
Use:
.content {
background: url('http://www.gransebryan.com/wp-content/uploads/2016/03/bryan-ganzon-granse-who.png') center no-repeat;
}
.displaybg {
text-align: center;
color: #FFF;
}