image manipulation

User 2698274 Photo


Registered User
27 posts

I'd appreciate somebody out there telling me how to assign a unique identifier to an image such that I can manipulate that image in my css file.

I have tried: <img id = "missionpic" src="Mission_San_Buenaventura.png" width=800 height=600 alt="" border="0" >

and in the css file

.missionpic {float: right;
margin-top: 5px;
margin-right: 10px
}

What am I doing wrong. Thanks
User 2484360 Photo


Registered User
3,293 posts

<img id = "missionpic" src="Mission_San_Buenaventura.png" width=800 height=600 alt="" border="0" >

Remove the space between the id="missonpic" :P
User 2698274 Photo


Registered User
27 posts

Adam East wrote:
<img id = "missionpic" src="Mission_San_Buenaventura.png" width=800 height=600 alt="" border="0" >

Remove the space between the id="missonpic" :P
User 2698274 Photo


Registered User
27 posts

Adam East wrote:
<img id = "missionpic" src="Mission_San_Buenaventura.png" width=800 height=600 alt="" border="0" >

Remove the space between the id="missonpic" :P

Thanks - tried it and no difference.
User 2287960 Photo


Ambassador
580 posts

Try changing .missionpic to #missionpic in css.

Keith
User 2698274 Photo


Registered User
27 posts

Keith W Jones wrote:
http://www.htmldog.com/guides/css/intermediate/classid/

Keith

That did it. Thanks. Whoopee. Now I know how.
User 2287960 Photo


Ambassador
580 posts

Glad you have got it sorted.

Keith
User 38401 Photo


Senior Advisor
10,951 posts

Keep in mind that another fix could also be to change the HTML line to say:

<img class="missionpic"

And leaving the dot in front of the missionpic selector in the CSS, which would then denote it as a class rather than an ID.

It all depends on if the attributes you are assigning to that image will be reused somewhere else on the same page.

ID = using it only once per page

CLASS = using it multiple times on a page.

Hope that helps some. :)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.