Old 02-03-2008, 22:08   #1 (permalink)
campbell
Web Hoster
 
Join Date: Jan 2008
Location: Canada
Posts: 122
Position Specified Images

Hi,

I was wondering how do you position specified images without affecting others?

I used this to position images withing a text box but it affects everyone, but i only want to affect one image.

Quote:
<style type="text/css">
#content img {float: right; margin: 5px;}
</style>

So, how can i position only a specified image alone?
  Reply With Quote
Old 03-03-2008, 00:25   #2 (permalink)
Mongoose
Senior Member
 
Mongoose's Avatar
 
Join Date: Oct 2007
Location: Olympia, WA
Posts: 151
Send a message via AIM to Mongoose
You can either give images you want to selectively position a class and style according to that or you can use attribute selectors to style them based on the image they link to:

img[src="./directory/image.png"] {
...
}
  Reply With Quote
Old 03-03-2008, 06:15   #3 (permalink)
haku
shiro
 
haku's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 1,815
Or you can give the image an ID and use the CSS on that ID.
  Reply With Quote
Old 03-03-2008, 18:37   #4 (permalink)
campbell
Web Hoster
 
Join Date: Jan 2008
Location: Canada
Posts: 122
So I would put this in the HTML doc?

Quote:
<style type="text/css">
img[src="./directory/image.png"] {float: right; margin: 5px;}
</style>
}

Also, how would I do it using an external CSS sheet? :S
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8