#div
that holds table, table tr td.class of td now what goes here to style a div class I put inside of the td class?
views:
97answers:
3Is this what you're looking for?
td.class-of-td div.class-of-div {
// Style of div of class "class-of-div" inside a td of class "class-of-td".
}
If your code looks like this:
<div id="mydiv">
<table>
<tr>
<td class="somecell">
<div>some text</div>
</td>
</tr>
</table>
</div>
.. then this CSS selector should do the trick:
#mydiv table tr td.somecell div
[Edited according to comment]
I'm not really sure what you mean, but I guess you should read up a little on CSS selectors :)
#
represents an ID
.
represents a class
The basic syntax of a selector is somewhat like this:
[Type][[# or .][name]] [.. next selector]
For example:
div#mydiv
.. will select a div with an Id of mydiv.
#mydiv
.. will select any object with an Id of mydiv
You can cascade the selectors by adding spaces between them, so:
div table.bluetable
.. will select all tables with a class of "bluetable" whose parent is a div.
Now, if I understood your comment correct, your code looks like this:
<div id="mydiv">
<table>
<tr>
<td class="somecell">
<div class="somediv">some text</div>
</td>
</tr>
</table>
</div>
.. then your selector would be
#mydiv table tr td.somecell div.somediv
Or in case you don't care about the class of the td's
#mydiv table tr td div.somediv
And in case you just want all divs with class="somediv"
div.somediv
Hope it helps :)
Try one of the guides here: google search