Webmaster Computer Resources Help And Learn To Earn Ideas!
I’m working on a layout, and I want to make the background of the DIV block to be fixed, because in some screen resolutions it repeats. How do I do this?
Comments (2)
in your style tag for that div make sure you add background-attachment:fixed;background-repeat:no-repeat; Hope I helped!
If you are using an image as the background and do not want it to repeat add “background-image-repeat:no-repeat” to your css.
For example, if you are using an external css file:
div#yourdiv { background-image:url(‘yourimage.jpg’); background-repeat:no-repeat; }
or, if you are defining your style directly in your html use this syntax:
You must be logged in to post a comment.
Welcome to WebmasterTechs.com, your source for great webmaster resources and tips! Enjoy the site!
October 7th, 2007 at 6:57 am
in your style tag for that div make sure you add
background-attachment:fixed;background-repeat:no-repeat;
Hope I helped!
October 7th, 2007 at 3:17 pm
If you are using an image as the background and do not want it to repeat add “background-image-repeat:no-repeat” to your css.
For example, if you are using an external css file:
div#yourdiv {
background-image:url(‘yourimage.jpg’);
background-repeat:no-repeat;
}
or, if you are defining your style directly in your html use this syntax: