473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Quickie # Is it possible to have child Class under ID ?

Say I have a <div id="content"for the main content column, and within
that column, I have several items, ie <div class="item"(each would be
some sort of article of sorts.)

In the CSS say I have #content { ... }

Why is it I cannot have #content.item { ... } as this seems to fail on
any browser I've tried (IE 6, FF 1.5, Moz 1.8b, NS 7, Opera 8), but I do
seem to recall that this was possible but I can't find the correct
syntax for this particular construct.

Thanks for any help.
Aug 21 '06 #1
2 1939
"Steve Kostecke" <sp******@ntp.isc.orgwrote:
>Say I have a <div id="content"for the main content column
Please do not multi post, see alt.html for answers.

--
Spartanicus
Aug 21 '06 #2
Steve Kostecke wrote:
Say I have a <div id="content"for the main content column, and within
that column, I have several items, ie <div class="item"(each would be
some sort of article of sorts.)

In the CSS say I have #content { ... }

Why is it I cannot have #content.item { ... } as this seems to fail on
any browser I've tried (IE 6, FF 1.5, Moz 1.8b, NS 7, Opera 8), but I do
seem to recall that this was possible but I can't find the correct
syntax for this particular construct.
#content.item { ... } would apply to an element that has *both*
id="content" and class="item". Since the class "item" is not applied
to the div with id="content" but a child (more generally, descendant)
of it, your CSS selector should look more like this:
#content .item { ... }
You were close, you just forgot a whitespace.

--
Vid the Kid

Aug 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Mark Johnson | last post by:
It doesn't seem possible. But would the following also seem a violation of the general notions behind css? You have a DIV, say asociated with class, 'topdiv'. Inside of that you have an anchor...
3
by: Joerg Toellner | last post by:
Dear Group, i have a self written c++-class that is used in many projects from many programmers. The functionality of this class requests, for some reasons, that any instance (object) of this...
2
by: Jm | last post by:
Hi All Im trying to get a bit of background info on .net.sockets for an app that im upgrading to be .net. Under vb6 i used the winsock control and would start it listening and it would call an...
2
by: Sam Marrocco | last post by:
If an object is the child of another object, is it possible to refer to the parent's properties? Put simply (in pseudocode), Public Class MyChild_Class Public NameOfChild as string End Class ...
14
by: Dave Booker | last post by:
It looks like the language is trying to prevent me from doing this sort of thing. Nevertheless, the following compiles, and I'd like to know why it doesn't work the way it should: public class...
3
by: Jack | last post by:
Hello, I have a 3-level class hirarchy: 1=Grandparent 2=Parent 3=Child The Grandparent has a method called OnPaint which I want to override from the Child class. I can do this, but how...
2
by: Jack | last post by:
Hello, I have a 3-level class hirarchy: 1=Grandparent 2=Parent 3=Child The Grandparent has a method called OnPaint which I want to override from the Child class. I can do this, but how...
5
by: shapper | last post by:
Hello, I have the following list: <ul id="parent" class="parent"> <li> <img... </li> <ul id="child" class="child"> <li>Message 1</li>
1
by: bytesFTW99 | last post by:
I have been struggling with this for some time can anyone help out? just trying to have 3 dropdown boxes that fill depending on what is selected, then in some cases click a button and have the second...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.