Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Two Concept Questions

2 views
Skip to first unread message

Novice

unread,
Dec 18, 2011, 6:57:29 PM12/18/11
to

I have two concept questions.

Question 1 (Inheritance):
I have some CSS where I am setting the color of my H3 headings with a div
called 'main' to one color, say black. In another div called 'index', which
is NOT within 'main' but parallel to it, I set my H3 headings to a
different color, say blue. I set the colors for 'main' first, then the
values of 'index'. The colors I set for 'index', ALWAYS take effect for
both 'main' AND 'index'.

I don't understand this. I could see that the values for 'index' would
clobber the values for 'main' if 'index' were somehow "above" (i.e. a
superset of) 'main' but they are parallel to one another. Why does 'main'
inherit its color from 'index' in this situation?

Just to make sure the situation is clear, here is the markup of the web
page:

<div id="container">
<div id="main">
</div>
<div id="index">
</div>
</div>

And this is the relevant bit of the CSS:

#main h3 {color: #FF0000;}
#index h3 {color: #0000FF;}

Question 2 (Omission):
For some reason that escapes me, none of my H2 headings is appearing on my
web page. They are properly coded in the HTML and both the HTML and CSS
validate without any errors or warnings. Other heading levels, like H1 and
H3 appear just fine. (I don't have any H4, H5, or H6). What's baffling me
is that I have no CSS at all that says anything about H2 headings one way
or the other. If a given tag isn't mentioned in CSS, shouldn't it be
rendered in the default fashion rather than being omitted?

I'm not looking for someone to fix my CSS here. I'm really just trying to
understand these basic concepts.

With regards to question 1, shouldn't properties only be inherited from
enclosing containers, not from parallel containers? With regards to
question 2, shouldn't any tag that is not mentioned in the CSS simply be
rendered in the default (visible) fashion, as opposed to omitted from the
page altogether?

--
Novice

dorayme

unread,
Dec 18, 2011, 7:54:23 PM12/18/11
to
In article <Xns9FBFC0E6...@94.75.214.39>,
Novice <novice@example..com> wrote:

> I have two concept questions.
>
> Question 1 (Inheritance):
> I have some CSS where I am setting the color of my H3 headings with a div
> called 'main' to one color, say black. In another div called 'index', which
> is NOT within 'main' but parallel to it, I set my H3 headings to a
> different color, say blue. I set the colors for 'main' first, then the
> values of 'index'. The colors I set for 'index', ALWAYS take effect for
> both 'main' AND 'index'.
>
> I don't understand this. I could see that the values for 'index' would
> clobber the values for 'main' if 'index' were somehow "above" (i.e. a
> superset of) 'main' but they are parallel to one another. Why does 'main'
> inherit its color from 'index' in this situation?
>
> Just to make sure the situation is clear, here is the markup of the web
> page:
>
> <div id="container">
> <div id="main">
> </div>
> <div id="index">
> </div>
> </div>
>
> And this is the relevant bit of the CSS:
>
> #main h3 {color: #FF0000;}
> #index h3 {color: #0000FF;}
>

If all that is really the markup then nothing at all would appear.

If it was

<div id="main"><h3>Red</h3>
</div>
<div id="index"><h3>Blue</h3>
</div>

then "Red" would be red and "Blue" would be blue, as you would
want.

> Question 2 (Omission):
> For some reason that escapes me, none of my H2 headings is appearing on my
> web page.

How can we tell when you do not provide the page in question?
Perhaps you have made your background black and the default text
color is likely black and you have not specified any other gor
h2, who knows?


> I'm not looking for someone to fix my CSS here. I'm really just trying to
> understand these basic concepts.

Have you at least read some basic tutorials like

http://htmldog.com/guides/cssbeginner/

?

If you have not, best to take a look and then ask about what you
might not get.

--
dorayme

Ben C

unread,
Dec 19, 2011, 3:25:40 AM12/19/11
to
On 2011-12-18, Novice <novice@example> wrote:
>
> I have two concept questions.
>
> Question 1 (Inheritance):
> I have some CSS where I am setting the color of my H3 headings with a div
> called 'main' to one color, say black. In another div called 'index', which
> is NOT within 'main' but parallel to it, I set my H3 headings to a
> different color, say blue. I set the colors for 'main' first, then the
> values of 'index'. The colors I set for 'index', ALWAYS take effect for
> both 'main' AND 'index'.
>
> I don't understand this. I could see that the values for 'index' would
> clobber the values for 'main' if 'index' were somehow "above" (i.e. a
> superset of) 'main' but they are parallel to one another. Why does 'main'
> inherit its color from 'index' in this situation?

It shouldn't and I've never seen it do that in any browser.

> Just to make sure the situation is clear, here is the markup of the web
> page:
>
><div id="container">
> <div id="main">
> </div>
> <div id="index">
> </div>
></div>
>
> And this is the relevant bit of the CSS:
>
> #main h3 {color: #FF0000;}
> #index h3 {color: #0000FF;}

There are no h3s in your markup. But it were like this:

<div id="container">
<div id="main">
<h3>foo</h3>
</div>
<div id="index">
<h3>bar</h3>
</div>
</div>

Then foo would be red and bar blue as you expect.

> Question 2 (Omission):
> For some reason that escapes me, none of my H2 headings is appearing on my
> web page. They are properly coded in the HTML and both the HTML and CSS
> validate without any errors or warnings.

Then they should appear.

> Other heading levels, like H1 and H3 appear just fine. (I don't have
> any H4, H5, or H6). What's baffling me is that I have no CSS at all
> that says anything about H2 headings one way or the other. If a given
> tag isn't mentioned in CSS, shouldn't it be rendered in the default
> fashion rather than being omitted?

Yes it should and does.

> I'm not looking for someone to fix my CSS here. I'm really just trying
> to understand these basic concepts.

Your understanding of the basic concepts is correct. You may be jumping
to whatever remains, however improbable it may seem, without first
eliminating the possible.

Maybe you left out a </div> somewhere so your document is not what you
think, but I can only guess.

> With regards to question 1, shouldn't properties only be inherited from
> enclosing containers, not from parallel containers?

Yes, they are.

> With regards to
> question 2, shouldn't any tag that is not mentioned in the CSS simply be
> rendered in the default (visible) fashion, as opposed to omitted from the
> page altogether?

Yes, it is.

dorayme

unread,
Dec 19, 2011, 4:27:49 AM12/19/11
to
In article <slrnjett84....@bowser.marioworld>,
Ben C <spam...@spam.eggs> wrote:

...

I think we both use albasani.

--
dorayme

Ben C

unread,
Dec 19, 2011, 8:29:13 AM12/19/11
to
Is that a news server? I think mine is giganews according to the
headers.

Novice

unread,
Dec 19, 2011, 8:51:28 AM12/19/11
to
dorayme <dor...@optusnet.com.au> wrote in
news:dorayme-13CAC8...@news.albasani.net:
Yes, of course. Sorry, I was just summarizing the HTML so that it was clear
that 'main' and 'index' were parallel to one another.

>> Question 2 (Omission):
>> For some reason that escapes me, none of my H2 headings is appearing
>> on my web page.
>
> How can we tell when you do not provide the page in question?
> Perhaps you have made your background black and the default text
> color is likely black and you have not specified any other gor
> h2, who knows?
>
>
>> I'm not looking for someone to fix my CSS here. I'm really just
>> trying to understand these basic concepts.
>
> Have you at least read some basic tutorials like
>
> http://htmldog.com/guides/cssbeginner/
>
> ?
>
> If you have not, best to take a look and then ask about what you
> might not get.
>
Thank you for the tutorial reference. I've never seen that one. I'll have a
look and come back if it doesn't answer my questions.


--
Novice

Novice

unread,
Dec 19, 2011, 8:57:03 AM12/19/11
to
Ben C <spam...@spam.eggs> wrote in
news:slrnjett84....@bowser.marioworld:
Sorry, I oversimplified the markup in an effort to show the structure.
The H3 headings are done the way you describe.

>> Question 2 (Omission):
>> For some reason that escapes me, none of my H2 headings is appearing
>> on my web page. They are properly coded in the HTML and both the HTML
>> and CSS validate without any errors or warnings.
>
> Then they should appear.
>
>> Other heading levels, like H1 and H3 appear just fine. (I don't have
>> any H4, H5, or H6). What's baffling me is that I have no CSS at all
>> that says anything about H2 headings one way or the other. If a given
>> tag isn't mentioned in CSS, shouldn't it be rendered in the default
>> fashion rather than being omitted?
>
> Yes it should and does.
>
>> I'm not looking for someone to fix my CSS here. I'm really just
>> trying to understand these basic concepts.
>
> Your understanding of the basic concepts is correct. You may be
> jumping to whatever remains, however improbable it may seem, without
> first eliminating the possible.
>
> Maybe you left out a </div> somewhere so your document is not what you
> think, but I can only guess.
>
I'll be looking at that next. I was just trying to be sure I understood
the concepts correctly first.

>> With regards to question 1, shouldn't properties only be inherited
>> from enclosing containers, not from parallel containers?
>
> Yes, they are.
>
>> With regards to
>> question 2, shouldn't any tag that is not mentioned in the CSS simply
>> be rendered in the default (visible) fashion, as opposed to omitted
>> from the page altogether?
>
> Yes, it is.

Thank you, Ben. At least I know my basic concepts are right. Now I just
have to see what stupid thing I did to mess myself up in this case ;-)


--
Novice

Jonathan N. Little

unread,
Dec 19, 2011, 9:38:18 AM12/19/11
to
Novice wrote:

> Sorry, I oversimplified the markup in an effort to show the structure.
> The H3 headings are done the way you describe.

You are also missing the most important point. You cannot diagnose
markup errors without actually *seeing* the markup! Unless you provide a
URL to an example of the actual markup that is giving you trouble then
anything anyone says is pure speculation and pointless. We will discuss
your problems when we actually *see* what you have a otherwise this is
just a silly game of 20-Questions.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

tlvp

unread,
Dec 19, 2011, 11:18:44 AM12/19/11
to
"We both"? dorayme: albasani; Novice: aioe; Ben C: giganews; me: Xanadu.

HTH. Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.

dorayme

unread,
Dec 19, 2011, 3:44:10 PM12/19/11
to
In article <umez7jy7i4wx$.msmnovd7...@40tude.net>,
tlvp <mPiOsUcB...@att.net> wrote:

> On Mon, 19 Dec 2011 20:27:49 +1100, dorayme wrote:
>
> > In article <slrnjett84....@bowser.marioworld>,
> > Ben C <spam...@spam.eggs> wrote:
> >
> > ...
> >
> > I think we both use albasani.
>
> "We both"?

A we both is a rare Australian marsupial, some of which species
have misbehaved so greatly that they were deported to the UK a
few years ago. But all Australians still try to keep in touch
with them a little bit.

--
dorayme
0 new messages