Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 07-14-2006, 02:09 PM CSS question
Novice Talker

Posts: 5
Name: Brett
Location: germany but from canada
Trades: 0
Hey I was trying to make a template similar to one that i saw, but when I made it, the title would always be lower when viewed in mozilla, and did not fit with the template. Finally after looking at the code of the page, I found out that the style

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

fixed the whole problem. I'd like to understand what that does, I'm kind of lost.
Thanks
tupixel is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-14-2006, 02:34 PM Re: CSS question
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
the * selector applies the style to all elements. Another example is:

Code:
#asd * {
margin: 0px;
padding: 0px;
}
it would apply to all the sub-elements in the element with a "asd" ID.

Last edited by funkdaddu; 07-14-2006 at 02:36 PM..
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 07-14-2006, 02:47 PM Re: CSS question
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It is generally good to get in the habit of zeroing out all the margins and padding first. I don't use the * because I want to control what gets zeroed out and what doesn't. Six of 1, 1/2 dozen of the other I suppose.

I usually do it this way:
Quote:
html, body, ul, ol, li, dl, p, h1, h2, h3, h4, h5, h6, form, formfield {
margin: 0;
padding: 0;
border: 0;
}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-14-2006, 05:23 PM Re: CSS question
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
IE and Firefox will often have different defaults for margins and paddings which is why it can be good to zero both out. With ordered and unorder lists one uses the margin and the other the padding to create the default indentation. I forget which browser uses which, but setting both to 0 gets them aligned.

I don't usually zero out everything, mostly because I've learned over time which elements are the likely ones to cause a problem for me, but anytime I see the two browsers displaying elements at different spacing the first thing I do is explicitly set the margins and paddings.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to CSS question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15295 seconds with 12 queries