Removing Margins And Padding From Fields...

Show off new creations, get help, or just chat about all aspects of web development and design.

Removing Margins And Padding From Fields...

Postby EagleStrike on Thu Nov 22, 2007 10:49 pm

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. :)
As I Walk Through The Valley Of Death, I Will Fear No Evil, Cos I'm The Meanest Fucker In The Valley...
EagleStrike
Pheropod
Pheropod
 
Joined: Sun Dec 03, 2006 7:26 pm
Location: London, England

Postby ChopperDave on Fri Nov 23, 2007 3:43 am

Helps if you give us your site and the CSS and HTML to go with it.
User avatar
ChopperDave
Rockstar San Diego
 
Joined: Wed Feb 21, 2007 6:06 pm

Postby dissonance on Fri Nov 23, 2007 5:21 am

Add !important to your CSS declarations.
i had fun once, and it was awful.
User avatar
dissonance
Veteran
Veteran
 
Joined: Wed Oct 10, 2007 12:35 am
Location: usa

Postby mbombz on Thu Dec 06, 2007 4:12 am

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.

http://www.bspworlds.com/padding.html

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.
m*
'Mr. Four Video Cards'
User avatar
mbombz
Member
Member
 
Joined: Wed Oct 24, 2007 11:45 pm
Location: San Francisco,CA,USA

Postby Wills on Thu Dec 06, 2007 9:38 am

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.
Jailbreaksource.net | Andy Wills

Maps, Textures, Modelling, Animation, Skins, Voices, Sound and Graphics

Image
User avatar
Wills
Been Here A While
Been Here A While
 
Joined: Fri Feb 02, 2007 9:13 am
Location: Sussex, England

Postby Blink on Thu Dec 06, 2007 10:24 am

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.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users