Reply
[CSS] Two image backgrounds.
Old 05-01-2008, 08:05 PM [CSS] Two image backgrounds.
Novice Talker

Posts: 5
Name: Adrian
I'm designing new site and I'd like to put there 2 image backgrounds. It should look like that:



Is it possible in CSS?
respectum is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-01-2008, 08:51 PM Re: [CSS] Two image backgrounds.
LadynRed's Avatar
Super Moderator

Posts: 5,973
Location: Tennessee
Yes, it's possible. You could put the patterned background in as a background for the body, then put the stripe in as a background on a "container" div, with the stripe set to repeat ONLY horizontally.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 02:21 AM Re: [CSS] Two image backgrounds.
Novice Talker

Posts: 5
Name: Adrian
I have a problem with defining the right code. Could you help me a little bit?
respectum is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 03:50 AM Re: [CSS] Two image backgrounds.
Average Talker

Posts: 15
that is possible using css code follow following step :-
1) create css class like
.g{
background:url(../images/image.jpeg);
}
2)
create table using table tag
<table>
<tr>
<td class="g"> <img src="../images/gh.jpeg">
</td>
</tr>
</table>

this code will create two image at a time
__________________
Web Site Development

Free Templates
gazal is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 11:47 AM Re: [CSS] Two image backgrounds.
LadynRed's Avatar
Super Moderator

Posts: 5,973
Location: Tennessee
NO TABLES !!!! Totally UNNECESSARY and definitely NOT modern web design

Adrian, you would need something like this:

HTML
<body>
<div id="container">
your header and the rest of your content, footer, etc. inside the container
</div>
</body>

CSS would be like this:

body{background: url(littleboxes.gif);}
#container{background url(bgstripe.gif) repeat-x;}

It's that easy.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 03:35 PM Re: [CSS] Two image backgrounds.
wayfarer07's Avatar
Insomniac

Posts: 487
Name: Abel Mohler
Location: Asheville, North Carolina USA
try adding this to your CSS document:
Code:
 table {display: none !important;}
and see if your document holds up...
__________________
Go FREELANCE <=====||=====> Hire Me
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 07:12 PM Re: [CSS] Two image backgrounds.
Novice Talker

Posts: 5
Name: Adrian
Thank you very much. I've found another way, more dificult. I've just put one layer (div) with z-index: 1 and I've defined its lenght and hight, after all I've just set the site background as stripes_bg.gif it also works.
respectum is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 08:09 PM Re: [CSS] Two image backgrounds.
LadynRed's Avatar
Super Moderator

Posts: 5,973
Location: Tennessee
Why on earth would you choose to do something the HARD way, especially when I gave you an EASY solution ?? If you start using absolute positioning on everything you're GOING to have problems.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 10:33 PM Re: [CSS] Two image backgrounds.
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
The Lady is right, her idea is easy, and keeps the code leaner than a table. On the other hand, I also like tables... I set my drinks down on a table... my dinner... my tv remote...
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Old 05-03-2008, 01:28 AM Re: [CSS] Two image backgrounds.
Skilled Talker

Posts: 79
Name: Nina
Location: Hong Kong
Quote:
Originally Posted by LadynRed View Post
NO TABLES !!!! Totally UNNECESSARY and definitely NOT modern web design

Adrian, you would need something like this:

HTML
<body>
<div id="container">
your header and the rest of your content, footer, etc. inside the container
</div>
</body>

CSS would be like this:

body{background: url(littleboxes.gif);}
#container{background url(bgstripe.gif) repeat-x;}

It's that easy.
Wow, thanks. I've actually been trying to figure out how to do this, lol. I've been doing it the hard way.. ^o^ Very useful, LadynRed
neener is offline
Reply With Quote
View Public Profile
 
Old 05-04-2008, 07:48 PM Re: [CSS] Two image backgrounds.
Gilligan's Avatar
Dead Like Me

Posts: 1,569
Name: Stefan
Location: London, UK
Quote:
Originally Posted by gazal View Post
that is possible using css code follow following step :-
1) create css class like
.g{
background:url(../images/image.jpeg);
}
2)
create table using table tag
<table>
<tr>
<td class="g"> <img src="../images/gh.jpeg">
</td>
</tr>
</table>

this code will create two image at a time
Ouch, I read this post and took an educated guess that LadynRed would b on your a$$ behind
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 05-04-2008, 08:40 PM Re: [CSS] Two image backgrounds.
Novice Talker

Posts: 10
Name: redhat
<div style="background:...">
<div style="background:...">
</div>
</div>
__________________
http://www.imhr.net
imhr is offline
Reply With Quote
View Public Profile Visit imhr's homepage!
 
Reply     « Reply to [CSS] Two image backgrounds.
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15813 seconds with 13 queries