Graham Support Administrator
Posts: 1,642 Status: Offline Gender: Male Location: Sussex, UK Age: 38 Joined:
Additional Groups: Support Team
pmwww | CSS control issues (10th Dec 08 at 11:44am UTC) | | Sometimes, i hate CSS
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.
I have this in the CSS (it is to make sure the nav i have floats where i want it to:
Code: - img {
- margin: 0;
- border: none;
- padding: 0;
- position: relative;
- float: left;
- }
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? | |
|
dog199200 Guest | Re: CSS control issues (10th Dec 08 at 12:09pm UTC) | | 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 | |
|
Graham Support Administrator
Posts: 1,642 Status: Offline Gender: Male Location: Sussex, UK Age: 38 Joined:
Additional Groups: Support Team
pmwww | Re: CSS control issues (10th Dec 08 at 10:40pm UTC) | | 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 | |
|
Marc vChat Developer
I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 31 Joined:
Additional Groups: Coding Team
pmwww | Re: CSS control issues (11th Dec 08 at 4:25am UTC) | | In the image tag itself, simply have it align center using an inline style attribute. Inline styles always override external & embedded styles. | |
rroll.to— Shorten a link, rickroll your friends. |
|
Michael Moderator
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | Re: CSS control issues (25th Dec 08 at 3:44am UTC) | | Why not give the image a class? Or the thing it's 'in' a class then you can do something like:
.nav img { ... }
| |
|