...

View Full Version : Formation?



BoldUlysses
05-14-2008, 03:45 PM
Is there a way to keep the default appearance of form elements like text input fields, pulldown menus and especially "submit" buttons while overriding margins, padding and borders for the rest of the page?

Page in question (the form is below the first table): http://www.imageworksdisplay.com/tobacco/index.php

I add this to the beginning of every style sheet:


* {
margin:0px;
padding:0px;
border:0px;
}

which just gets everything and every browser (for the most part) on an even playing field. However, because the values are inherited it also wipes out the appearance of form elements. I happen to like the way the default form buttons look, among other things.

Is there a way to restore the defaults to the form by itself? I'd rather not go through the style sheet and nix the margins, padding and border on everything individually. Ideas?

THANKS!

abduraooft
05-14-2008, 03:51 PM
Add some classes to your elements like


<input type="text" class="text" />

<input type="text" class="button" />

<select class="text" >
</select>
Then applly a CSS like

input.button{
border-width:1px;
border-color: #777 #000 #000 #777;
padding:2px;
}
input.text, textarea
{
border-width:1px;
border-color: #000 #777 #777 #000;
padding:2px;
}

BoldUlysses
05-14-2008, 03:52 PM
Nevermind. I just replaced the * with a list of all the elements (except those related to the form) that I have on the page:


html, body, div, p, h1, h2, h3, h4, img, table, tr, td {
margin:0px;
padding:0px;
border:0px;
}

Bingo. Not a whole lot when it comes down to it.

abduraooft
05-14-2008, 03:58 PM
Dan Schulz had posted a detailed CSS on this
http://www.codingforums.com/showpost.php?p=664410 :)

BoldUlysses
05-14-2008, 04:20 PM
That's great. I appreciate the link.

_Aerospace_Eng_
05-14-2008, 07:35 PM
There is also the one by Eric Meyers.
http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum