Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help me interpret style sheets

Help me interpret style sheets
Thread Tools
Mac Elite
Join Date: Feb 2001
Location: Los Angeles, CA, USA
Status: Offline
Reply With Quote
Nov 10, 2005, 04:18 PM
 
So, the more I look at stylee sheet examples, the more it hurts. Can someone explain this to me?

h4.post-title a, div.post-title span {

For the life me, I can't figure out what this means. Is there an A tag inside an H4 tag with a class of post-title? I'm totally lost, looking at examples and I was wondering if anyone could explain this to me.

Thanks in advance,
The CSS Impaired One
     
Mac Elite
Join Date: Apr 2003
Location: SoCal
Status: Offline
Reply With Quote
Nov 10, 2005, 04:37 PM
 
Just take it one step at a time.

h4 H4 element, obviously
. With a class of
post-title post-title
[Space] Containing
a An A element

So yes, you’re right – it’s referring to an anchor enclosed within an H4 that has a class of “post-title”.

<h4 class="post-title"><a /></h4>
     
Professional Poster
Join Date: Jan 2001
Location: Manchester,UK
Status: Offline
Reply With Quote
Nov 10, 2005, 04:38 PM
 
Easy to interpret, but very very odd. The comma in there means that the 'styling' is for 2 items.
First (h4.post-title a) is a link (the 'a' bit from 'a href') within a h4 with a class of post-title (the html will look something like this
Code:
<h4 class="post-title"><a href="link">style applied to this text</a></h4>
for some odd reason this shares it's styling with the next bit (div.post-title span). which will be applied to all span tags contained within a div with a class also of post-title. the html may look something like this
Code:
<div class="post-title"><span>style applied to this text</span></div>
The odd thing is that there is going to be some regular text that's going to look the same as a link that's within a header
     
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Nov 11, 2005, 10:15 AM
 
Originally Posted by Mediaman_12
The odd thing is that there is going to be some regular text that's going to look the same as a link that's within a header
No that's not really odd, because you don't know they are going to be exactly the same.

If there are items that are *close* to having the same style, it makes perfect sense to have them share styles and then just change a few things in one or the other... not only does it save on CSS file size, but it sure make maintenance easier too.

Just for example since we don't know what the styles actually are, something like this is pretty common, especially on related items that have similar styles:
Code:
h4.post-title a, div.post-title span { text-align: right; color: #990000; font-size: .9em; padding: 2px 10px; margin: 0; } div.post-title span { font-size: .8em; }
The only thing necessary for evil to flourish is for good men to do nothing
- Edmund Burke
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:42 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2