I hope whoever here knows what I mean by selector, as in the CSS selector that is used to pick what XHTML elements the styles are applied to.
CSS Code:
HTML Code:
What I'm trying to do is take the above code an simplify it as much as possible.
The hr tags will be wrapped in a specific div tag with a specific class attribute, so the CSS selectors will be div.corners-top hr.one for example instead of what I have in the example.
The above works, perfectly, but I'm not so sure if I can use CSS to simplify the HTML even more so (the HTML will be repeated several times per page, so using CSS to simplify it as much as possible will reduce file size).
I want to be able to take the HTML code, and convert it from what it is to something like this...
But still have unique style attributes for each hr tag without explicitly defining it anywhere but in the CSS document.
I've heard of the pseudo class first-child, but I'm not sure if you can mimic that functionality for the second, third, fourth and so on.
Perhaps the pseudo element :after could be used?
Etc...
So I could just do...
(I'm gonna give the above a try right now)
Example of current use: http://preview.moltx.name/newtemplat...tes/dlive.php5
The source code is using <span> tags, not hr tags in repetitions of ten for both top and bottom rounded corners.
CSS Code:
Code:
hr.one {}
hr.two {}
hr.three {}
hr.four {}
hr. five {}
hr.six {}
hr.seven {}
hr.eight {}
hr.nine {}
hr.ten {}
Code:
<hr class="one" /> <hr class="two" /> <hr class="three" /> <hr class="four" /> <hr class="five" /> <hr class="six" /> <hr class="seven" /> <hr class="eight" /> <hr class="nine" /> <hr class="ten" />
What I'm trying to do is take the above code an simplify it as much as possible.
The hr tags will be wrapped in a specific div tag with a specific class attribute, so the CSS selectors will be div.corners-top hr.one for example instead of what I have in the example.
The above works, perfectly, but I'm not so sure if I can use CSS to simplify the HTML even more so (the HTML will be repeated several times per page, so using CSS to simplify it as much as possible will reduce file size).
I want to be able to take the HTML code, and convert it from what it is to something like this...
Code:
<div class="corners-top"><hr /><hr /><hr /><hr /><hr /><hr /><hr /><hr /><hr /><hr /></div>
I've heard of the pseudo class first-child, but I'm not sure if you can mimic that functionality for the second, third, fourth and so on.
Perhaps the pseudo element :after could be used?
Code:
div.corners-top:after {}
div.corners-top:after:after {}
div.corners-top:after:after:after {}
div.corners-top:after:after:after:after {}
div.corners-top:after:after:after:after:after {}
So I could just do...
Code:
<hr class="corners-top" />
Example of current use: http://preview.moltx.name/newtemplat...tes/dlive.php5
The source code is using <span> tags, not hr tags in repetitions of ten for both top and bottom rounded corners.
Comment