• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wondering if the following is standard css

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a site with joomla, and in the css are the following three elements (elements the right word?):

Can someone here help me understand how these are related? I guess if I could figure out what the .width_medium, .width_fmax, and .width_small methods were for it would be a start. I will look that up and hopefully find the answer myself, but since I started this thread already I will go ahead and post it here too just in case.

edit - also div#wrapper is something I do not understand
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS 101 is what you need: class and id

If you read the selector it says

I want an element that is a body that has a class of XXX and it contains an element that is a div that has an id of YYYY

Depending on what class you put on the body, it changes what gets applied to the div.

Eric
 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh so when using this in the html you would use only one of those? That makes sense. I have done the css tutorial on w3school and I have worked with it somewhat, but creating the class and using it in the html is about as far as I have learned. I figured anything after a " . " would be a method (.width_fmax in this case). So that is just part of the class name then right, not a method?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS does not have methods
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. means class name
# means id
 
christian gibson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like my problem as well. I am not a CSS expert and I don't understand the whitespace separating body.width_medium from div#wrapper in the CSS selector. Apparently this is not a case of grouped selectors, because otherwise they would be separated by a comma delimiter? Also I don't understand why the identifier #wrapper is called div#wrapper. w3schools is great, but it doesn't really explain this for us dummies ....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
christian gibson wrote:Apparently this is not a case of grouped selectors ...
Space denotes ancestry. The selector "E F" means all F elements that are children of E elements; for example: "p a" is all anchor tags that are children of p tags.

Also I don't understand why the identifier #wrapper is called div#wrapper.
That means only choose an element with id of wrapper if it is a div. It won;t match an element with that id if it is anything other than a div.
 
christian gibson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi bearbibeault - thanks for your clear explanation. In the meantime I found this tutorial http://css.maxdesign.com.au/selectutorial/selectors_child.htm which explains so many mysteries
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic