vForums Support > Programming & Coding :: Programming Discussion :: > CSS control issues

CSS control issues - Posted By Graham (amusedtodeath) on 10th Dec 08 at 11:44am
Sometimes, i hate CSS {Sad}

Trying to work out at the moment to control the behaviour of an image that is controlled by another part of the css.

Confused? Fantastic. {Cheesy}

I have this in the CSS (it is to make sure the nav i have floats where i want it to:

Code:
 
  1. img {
  2.     margin: 0;
  3.     border: none;
  4.     padding: 0;
  5.     position: relative;
  6.     float: left;
  7.         }
 


However, in another div i have an image i would like centered but as they are in img tags they are floating to the left. Is there a way to force this one image to do as it's told, or have i just got to live with it? {Tongue Out}

Re: CSS control issues - Posted By dog199200 (dog199200) on 10th Dec 08 at 12:09pm
tired duplicating the css code above, naming the second one something else and then assigning the css to the images accordingly through class or id?

If that doesnt make sense i'm sorry

Re: CSS control issues - Posted By Graham (amusedtodeath) on 10th Dec 08 at 10:40pm
Posted By dog199200 on 10th Dec 08 at 12:09pm
 
tired duplicating the css code above, naming the second one something else and then assigning the css to the images accordingly through class or id?

If that doesnt make sense i'm sorry


I think i understand, but if you could make it a bit clearer then i'd really appreciate it {Smile}

Re: CSS control issues - Posted By Marc (cr0w) on 11th Dec 08 at 4:25am
In the image tag itself, simply have it align center using an inline style attribute. Inline styles always override external & embedded styles. {Wink}

Re: CSS control issues - Posted By Michael (wrighty) on 25th Dec 08 at 3:44am
Why not give the image a class? Or the thing it's 'in' a class then you can do something like:

.nav img {
...
}


{Unsure}