On 1 May 2007, at 20:21, Brenton Strine wrote:

However, if I then wanted to add additional special
styling to the first and third div, (e.g.. a border and
background color) it is less graceful. I could add style
attributes, but that would be wasteful if I want to do
this on a large scale. Multiple classes would be
confusing.

A nice solution would be the addition of a few div tags.
(e.g. <div2>, <div3>, <div4> and <div5>.) Then you could
do something like this:

<style>
div1 {text-indent:0px;}
div2 {text-indent:10px;}
div3 {text-indent:20px;}
</style>

Why not:

<!DOCTYPE html>
<style>
.first {
color: red;
}
.first + div {
text-indent: 10px;
}
.first + div + div {
text-indent: 20px;
color: blue;
}
</style>
<div class="first">Indent 0</div>
<div>Indent 1</div>
<div>Indent 2</div>
<div class="first">Indent 0</div>
<div>Indent 1</div>
<div>Indent 2</div>


Reply via email to