SunQuest
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 25th, 2003, 07:09 AM
summercom's Avatar
summercom summercom is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Michigan, USA
Posts: 196 summercom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 5 m 3 sec
Reputation Power: 6
vary image with css?

is there any way to change the image that is used in a <img> tag with css?

something like this...

Code:
img.image
{
  image: url(image.jpg);
  width: 100px;
  height: 100px;
}


<img class="image" alt="blah" />

Reply With Quote
  #2  
Old December 25th, 2003, 07:51 AM
Winters Winters is offline
Bad Coder
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Posts: 1,742 Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 10 h 57 m 14 sec
Reputation Power: 171
Not really. CSS was developed to seperate content from layout.

CSS being for layout and HTML for content.

What are you looking for? A random image display?

Reply With Quote
  #3  
Old December 25th, 2003, 08:14 AM
summercom's Avatar
summercom summercom is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Michigan, USA
Posts: 196 summercom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 5 m 3 sec
Reputation Power: 6
no i just wanted to have different stylesheets for my past layouts of my site

Reply With Quote
  #4  
Old December 25th, 2003, 11:20 AM
stinkoman's Avatar
stinkoman stinkoman is offline
what's your moniker?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Highland Park, NJ
Posts: 201 stinkoman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to stinkoman
Ok, well what you want to do, is use css image replacement. Basically you make a div with a background image specified as well as height and width. also define a span with {display:none}

in the html put

<div id="image"><span>alt text</span></div>

the benefit is that you can change the image in the style sheet, without changing the html.

the downside is search engines like to see IMG tags, and the lack of any could hurt you in the SERPs

Merry Freaking Xmas!!!
__________________
new jersey web design

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > vary image with css?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway