background picture repeating
Moderator: General Moderators
background picture repeating
hi there....is there a way i can control the background picture not to repeat?thnx
CSS
something like
something like
Code: Select all
background-image:url(/images/jobdesc/adwgrid.gif);
background-repeat:no-repeat;or even in your css
Code: Select all
body{
background:url(/images/interface/body-bg.gif) no-repeat;
}- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Drifting *slightly* off-topic but when using no-repeat you often wish to have control over the position of the background.
Take a wild guess which CSS atrribute does that one
http://www.w3schools.com/css/ is a nice resource by the way 
Take a wild guess which CSS atrribute does that one
Code: Select all
body{
background:url(/images/interface/body-bg.gif) no-repeat;
background-position: top left;
}the image does not load....i edit my css file and put something like this
Code: Select all
body{
background:url(/images/dome.jpg) no-repeat;
background-position: top left;
}not if he is using root relative paths, which i think he isonion2k wrote:Are you sure? If you're using an external CSS file the path to the image needs to be relative to the CSS file, not the php script. So if your CSS is in a directory you'd need a "../" in the path..pleigh wrote:thanks...yes, the url is correct...
Try
One dot (.) means the current directory
Code: Select all
background:url(./images/dome.jpg) no-repeat;tried this one and still not working....i tried to call the css file to another page, but it is also not working....below is my css code for body{}wwwapu wrote:TryOne dot (.) means the current directoryCode: Select all
background:url(./images/dome.jpg) no-repeat;
Code: Select all
body {
background-image: url(/images/table.jpg) no-repeat;
background-position: top right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px
}try:pleigh wrote:tried this one and still not working....i tried to call the css file to another page, but it is also not working....below is my css code for body{}wwwapu wrote:TryOne dot (.) means the current directoryCode: Select all
background:url(./images/dome.jpg) no-repeat;
Code: Select all
body { background-image: url(/images/table.jpg) no-repeat; background-position: top right; font-family: Arial, Helvetica, sans-serif; font-size: 12px }
Code: Select all
body {
background: url("e;/images/table.jpg"e;) no-repeat top right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Well the most foolproof way instead off cramming as much into one attribute to fix an issue is to break it up and see what causing the problem.
Code: Select all
background-image: url(/images/table.jpg);
background-repeat: no-repeat;
background-position: top right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px