Topic: two backgrounds in one element? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30570" title="Pages that link to Topic: two backgrounds in one element? (Page 1 of 1)" rel="nofollow" >Topic: two backgrounds in one element? <span class="small">(Page 1 of 1)</span>\

 
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 09-27-2008 16:11 Edit Quote

hello, i was wondering if it there was any trick to have two backgrounds in an element like DIV.

for example one repeating and one not repeating?

thanks!

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 09-27-2008 16:53 Edit Quote

Unfortunately not in CSS2, but that's part of CSS3.
You sure you don't have a parent or sibling element you could somehow "abuse", pad or whatever, to achieve what you want without bloating the markup ?

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

IP logged posted posted 09-27-2008 21:47 Edit Quote

If I'm understanding what you are wanting, I have done it by making the background image a lot bigger than needed. Kind of like the bottom image used here

Later,

C:\

esskay
Bipolar (III) Inmate

From:
Insane since: Jan 2005

IP logged posted posted 09-28-2008 02:58 Edit Quote

How about through containment, like this?

code:
<style>
div {
	margin: 0px;
	padding: 0px;
}
.bg1 {
	background-image: url(bg1.png);
	background-repeat: repeat-x;
}
.bg2 {
	background-image: url(bg2.png);
	background-repeat: no-repeat;
	background-position: 10px 10px;
}
</style>
<div class="bg1">
	<div class="bg2">
		Yippie
	</div>
</div>



Regards,
- SK



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu