vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: CSS control issues - View Topic
Topic Rating: *****
Printable View
Graham
Support Administrator
*****

[Avatar]

Posts: 1,642
Status: Offline
Gender: Male
Location: Sussex, UK
Age: 38
Joined:  

Additional Groups:
Support Team
***


Reputation: 57%  


pmwww
CSS control issues (10th Dec 08 at 11:44am UTC)
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}
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
*****

[Avatar]

Posts: 1,642
Status: Offline
Gender: Male
Location: Sussex, UK
Age: 38
Joined:  

Additional Groups:
Support Team
***


Reputation: 57%  


pmwww
Re: CSS control issues (10th Dec 08 at 10:40pm UTC)
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}
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 31
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


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. {Wink}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
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 {
...
}


{Unsure}
 Printable View

All times are GMT+0 :: The current time is 12:15pm
Page generated in 2.7058 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums