» Snippets » css » Set an image center of web page background using css
Using css you can easily set an image in the middle of your web page background. There are several ways to do that. Today I'm going to show you most simplest way to set an image center of the web page background.
- Write a simple CSS Class:
div.centered-image{
width: 100%;
height: 100%;
background: url('image.png') center center no-repeat;
}
- Write a simple HTML
Create a div and add "centered-image" class. Very simple!
<div class="centered-image"></div>
Publish your snippets with us & be an exclusive author!
More Recommended Snippets:
Topics