 |
 |
Help me interpret style sheets
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Los Angeles, CA, USA
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |