Basicly I have defined an img tag to have a black border around it using this bit of code.

img {border:4px solid; color:#000000 }

I was going to use a text based logo but have used a non standard font so it looks rubbish. I now need to design a logo which i have done, but beacuse of the code above it has a box round it.(im just inserting it in <img></img> tags)

Is there anyway i can stop this happening eihter by telling a paticular inmstance of a tag to ignore that bit of CSS or by creating a new tag to handle the logo.

I have tried doing it like this .logo{ image: url(graphics/logo1.gif) } and the n using a span tag but that doesn't work.

so umm any ideas???

Recommended Answers

All 6 Replies

Remember that the "C" in CSS stands for "Cascading". That means there is a hierarchy of styles. If two style definitions conflict, the most specific wins. So for a particular img, if you wish to override the class definition, then provide an inline definition for that image.

i see what your saying but can't work out the code. im trying.
<img src="graphics/logo1.gif" width="234" height="134" border:0px> as the img tag but it is not overiding it. what am i doing wrong.

i see what your saying but can't work out the code. im trying.
<img src="graphics/logo1.gif" width="234" height="134" border:0px> as the img tag but it is not overiding it. what am i doing wrong.

It is supposed to be like this

<img src="graphics/logo1.gif" width="234" height="134" style="border:0px;">

With inline declaration you have to call "style" for CSS and then change parameters.

Exactly, I should have been more clear. You have to use the "style" property, and the value contains your delimited style declarations. Thanks, Peter.

ahh that makes sense. will have to try and remember tht one. cheers to you both.

Also, I recommend learning about the use of 'classes' and 'ids' involving CSS, since trying to use CSS without classes or ids is like trying to play the piano without any fingers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.