Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 5
Name: Adrian
Trades: 0
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
 
 
Register now for full access!
Old 05-01-2008, 08:51 PM Re: [CSS] Two image backgrounds.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

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
Trades: 0
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
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE


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
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 03:35 PM Re: [CSS] Two image backgrounds.
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
try adding this to your CSS document:
Code:
 table {display: none !important;}
and see if your document holds up...
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-02-2008, 07:12 PM Re: [CSS] Two image backgrounds.
Novice Talker

Posts: 5
Name: Adrian
Trades: 0
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
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

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: 223
Location: Flordidian
Trades: 0
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...
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
Trades: 0
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
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to [CSS] Two image backgrounds.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.81860 seconds with 12 queries