|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I would like to have a background repeated in the x axis and padded in the y axis, I've take a look at the specs
but I couldn't find how to do the padding part, is it posible ? Thank you. ![]()
__________________
Pupeno: pupeno@pupeno.com http://www.pupeno.com Science Fiction Readers: http://sfreaders.com.ar |
|
#2
|
||||
|
||||
|
body {background-repeat:repeat-x; background-position:0% 50%;}
= 0% on the x axis (ie far left) and 50% on the y axis (center) |
|
#3
|
|||
|
|||
|
That won't do it, maybe I didn't express myself correctly, what I wanted to do is stretch the background vertically and repeat it horizontally, I think it's not posible with CSS2.
Carpe diem ![]() |
|
#4
|
||||
|
||||
|
Ahh, stretch it.
I don't think you can do it, but there is a possible alternative: create a <div> that is 100% height and 100% width, positioned absolutely 0/0. Create another <div> the same 100% width/height, pos 0/0, but make this higher in the z-index, and give it a background-color of transparent. Put all your page content in the second <div>. The first <div> now essentially acts as the page background. Using Javascript Calculate how many images you are going to need horizontally to fill the screen. And put that many into the background <div>. Calculate the page height in pixels and set all the images in the background <div> to that height. You should now have what you were after... |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > backgrounds and CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|