Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set image src in <style>?

Status
Not open for further replies.

ThatRickGuy

Programmer
Oct 12, 2001
3,841
US
Just a quick one, is there a way to set the src of an img in the <style> block of an external style sheet?

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
or, trying this another way...
Code:
        div.Icon
	{
		FLOAT:left;
		WIDTH:16px;
		HEIGHT:12px;
		background:url(Images\FormerEmp.gif);
		top left no-repeat;
	  	margin-left:0px;
	}

and then using <div class="Icon"></div> in the html. The div holds the space correctly, but the background image does not appear. hrmm.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
never mind, I copy/paste poorly.

Code:
	div.Icon
	{
		FLOAT:left;
		WIDTH:16px;
		HEIGHT:12px;
		background: url(Images/FormerEmp.gif) no-repeat;
	}

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 

There is a way, but it would be IE-only, as it would involve coding behaviours (which would be linked to from the external CSS).

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top