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
What does the little '*' thing do?
Old 02-08-2010, 12:02 PM What does the little '*' thing do?
Burnsie's Avatar
Skilled Talker

Posts: 81
Trades: 0
hi all
I was hoping some lovely person could clear something up for me.
I have been trying for many hours to get a menu list to line up correctly within a containing div. However, it wasn't happening! The list would only position itself below the containing div and not inside it no matter what I tried.
In desperation I aquired someone elses working css and pasted it into mine.
This cleared up the problem! When I stripped out the superfluous code I found the code that I needed was:
* {
PADDING-BOTTOM: 0px;
MARGIN: 0px;
PADDING-LEFT: 0px;
PADDING-RIGHT: 0px;
PADDING-TOP: 0px
}

So my question is what does the little * do for me and how does it know what to do. I seem to be able to put it anywhere in my css and it still goes on working! How does it know what to link to? Why can't I just put that info in my containing div? It's all very strange

cheers in advance
Burnsie
Burnsie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-08-2010, 12:35 PM Re: What does the little '*' thing do?
Experienced Talker

Posts: 43
Trades: 0
I'm not a expert in CSS but i thought * is a universal selector that matches the name of any element

More info about it http://www.w3.org/TR/CSS2/selector.html
TheSir is offline
Reply With Quote
View Public Profile
 
Old 02-08-2010, 01:39 PM Re: What does the little '*' thing do?
Chris_123K's Avatar
Super Talker

Posts: 128
Name: Chris Kummelstedt
Trades: 0
It is indeed, not only any name as in ID but also Class, I believe,

It is not used too much usually as very few elements will all share one property on most websites,

if you want to select specific elements you can use # (for id) and . (for class) such as:

.paragraphs

#paragraph1

for more info on these selectors: http://www.w3schools.com/css/css_id_class.asp
Chris_123K is offline
Reply With Quote
View Public Profile
 
Old 02-08-2010, 01:41 PM Re: What does the little '*' thing do?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
That's it

It is a "wildcard"

The
HTML Code:
* {
   margin: 0;
   padding: 0;
}
code, is known as a "CSS reset" and sets the padding and margins of ALL elements to 0.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-08-2010, 02:22 PM Re: What does the little '*' thing do?
Experienced Talker

Posts: 43
Trades: 0
Just a little add-on, its not a "wildcard"

You cant use it like:
Code:
.img1,.img2,.img3, {z-index: 99;}

.img* {z-index: 99;}
If it was a "wildcard" then that would be possible.
TheSir is offline
Reply With Quote
View Public Profile
 
Old 02-12-2010, 08:35 AM Re: What does the little '*' thing do?
Burnsie's Avatar
Skilled Talker

Posts: 81
Trades: 0
I see...but why can't I put that stuff in the list's container div? why do I need to use the little * thingamy?
Burnsie is offline
Reply With Quote
View Public Profile
 
Old 02-14-2010, 03:05 AM Re: What does the little '*' thing do?
GeekSpecialties's Avatar
Super Talker

Posts: 132
Name: Leonard
Location: Minnesota, USA
Trades: 0
Research CSS reset.

It's a bigger issue with different browsers applying different margins and padding by default. Using it once for all elements start them all equal.
__________________
Len,

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


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

GeekSpecialties is offline
Reply With Quote
View Public Profile Visit GeekSpecialties's homepage!
 
Old 02-14-2010, 07:37 AM Re: What does the little '*' thing do?
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
Quote:
Originally Posted by TheSir View Post
Just a little add-on, its not a "wildcard"

You cant use it like:
Code:
.img1,.img2,.img3, {z-index: 99;}

.img* {z-index: 99;}
If it was a "wildcard" then that would be possible.
really? then you should read this
http://www.sitepoint.com/blogs/2005/...hild-selector/
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-15-2010, 05:03 PM Re: What does the little '*' thing do?
Experienced Talker

Posts: 43
Trades: 0
Whats your point? That site is talking about using * as a universal selector which it is in CSS, not as a wildcard.

CSS just doesn't have wildcards.
TheSir is offline
Reply With Quote
View Public Profile
 
Old 02-15-2010, 11:40 PM Re: What does the little '*' thing do?
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
because that link shows it being used as a wilcard

i.e. in the sense of your ".img* (z-index: 99 according to what your wrote
"If it was a "wildcard" then that would be possible." if it's possible then it's a wildcard.

that's my point
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-16-2010, 07:22 AM Re: What does the little '*' thing do?
Experienced Talker

Posts: 43
Trades: 0
Maybe you dont understand how a wildcard normally works but they dont use it as a wildcard.
Normally a wildcard means that for example * is the same as anything not everything like a universal selector.

So new example:
.img1 and .img10 and .imgwhatever are the same as .img* if CSS had a wilcard, and it wont affect .img. But again CSS doesnt have wildcards, so thats just not possible in CSS.
TheSir is offline
Reply With Quote
View Public Profile
 
Old 02-16-2010, 08:05 AM Re: What does the little '*' thing do?
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
ah you mean like that. ok now i get you. yes you're right then, it's not a wildcard
phew glad we got that sorted; i was starting to get confused
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-16-2010, 08:30 AM Re: What does the little '*' thing do?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Shall I qualify my statement with

It is a wildcard selector NOT a wildcard character replacement
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to What does the little '*' thing do?
 

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 1.15399 seconds with 12 queries