|
| |
|
|
BeTheBall
Posts: 6336 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
Class and ID - 3/13/2007 12:03:26
I have a form with an ID of ws. My stylesheet contains the following: #ws label, #ws input, #ws select { display: block; margin-bottom: 10px; } #ws label { text-align: right; width: 350px; margin-right: 20px; float: left; } #ws br { clear: left; } I need to insert a couple of checkboxes into my form and need to override some of the above attributes. I placed the checkboxes inside a div and gave it a class name of cbGroup. However, I am finding it very difficult to override the above settings. For example, I want the text of the checkbox labels within the div to be left aligned, not right aligned. So, I added the following: label.cbGroup {text-align:left;} That seems to be completely ignored. Any thoughts on how to go about this? One other major annoyance is something in the above is causing a line break between the checkbox and its label.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
BeTheBall
Posts: 6336 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: Class and ID - 3/13/2007 14:53:11
Thanks Helena. I was able to track down the problems. First, it seems that a style assigned to an ID will generally override one that is part of a class. So, I modified my stylesheet to replace the style I had assigned to an id with a class style. Getting the label to not fall below the checkbox was giving me fits until I realized I was placing the float:left on the wrong element. I was putting it on the label when I needed it on the checkbox. Once I moved it where it needed to be, everything fell into place. I try to not get too fancy with my forms, but one thing I hate is when a long checkbox label wraps below the checkbox. It just looks bad to me. So, that is what all the fuss was about.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Tailslide
Posts: 5915 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: Class and ID - 3/18/2007 2:58:38
Ah thanks for finding Gary's form example Corey! I lost all my bookmarks a while back and haven't found a quarter of what I lost.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
coreybryant
Posts: 2422 Joined: 3/17/2002 From: Castle Rock CO USA Status: offline
|
RE: Class and ID - 3/18/2007 9:45:20
Glad to have helped.. I just had the same problem a few weeks ago and it surely helped me. It kept it very simple
_____________________________
Corey R. Bryant Merchant Accounts | Toll Free Numbers | My Blog | Expression Web Blog
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|