Page 1 of 1

Removing Margins And Padding From Fields...

PostPosted: Thu Nov 22, 2007 10:49 pm
by EagleStrike
So far, no matter what I have tried, the fields on my under construction web site manage to retain their padding/margins. I have so far been attempting their removal using a class css from the header, but unfortunately it just will not go away! Could anyone please provide me with a fail safe way of sending their fat little asses into oblivion? Thankyou. :)

PostPosted: Fri Nov 23, 2007 3:43 am
by ChopperDave
Helps if you give us your site and the CSS and HTML to go with it.

PostPosted: Fri Nov 23, 2007 5:21 am
by dissonance
Add !important to your CSS declarations.

PostPosted: Thu Dec 06, 2007 4:12 am
by mbombz
EagleStrike, I'd like to help but as ChopperDave and dissonance point out - it's hard without more information.

You definately want to do this with css. I threw together a sample page with a little stylesheet inline so you can easily view the source. Note the class 'inputtext' is already defined in the stylesheet but it can be overridden (or set) in the input tag as well. Note each field has a different display font as well.

Note: CSS is powerful and everyone has their own style. I set this quick example up so you could see a few usages since I don't know how deep into CSS your site will go, nor do I know your coding skill level.

Of course this assumes I understood what you were looking for to start with. My luck I am in left field :-). Shoot me a message if you don't want to post your code/information publically and I will try to help more.

PostPosted: Thu Dec 06, 2007 9:38 am
by Wills
I assume you've tried:

padding: 0px;
margin: 0px;

for the class in question?

Also, if the margins and padding have been set, and wont go away, there's likely some stray code somewhere... e.g. You've set some margin and padding parameters in a seperate div class, but nested the div class in question inside that class, so the parameters follow through. The above code should fix that too, though.

It also depends if you're setting the CSS in a seperate file, or from within the same HTML file, but the above still applies.

Again, if none of this helps, post the CSS code, I'm fairly fluent in the stuff, so I should be able to help.

PostPosted: Thu Dec 06, 2007 10:24 am
by Blink
Put this at the top of your CSS:

Code: Select all
padding: 0;
margin: 0;

Always wise to reset the browser defaults first, then set your own further down.