![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
*Haines Brown* <brownh (AT) teufel (DOT) hartford-hwp.com>: Christoph Paeper <crissov2003Q4 (AT) gmx (DOT) net> writes: Such changes more often happen with classes over time than with ids, but why not be consistent? |
#12
| |||
| |||
|
|
[snip] Not to be argumentative, but why be consistent? I think of ID as something specific to this particular document |
|
So if they are opposite in purpose, why should they be consistent in form? |
|
That's why I tend to be very ad hoc when it comes to the ID ("SecondParagraphPadding-top," "indent2em", etc.), hinting its specific location or purpose (well, not as ugly as the examples). I don't want to be generic here. |
#13
| |||
| |||
|
|
Haines Brown wrote: Not to be argumentative, but why be consistent? I think of ID as something specific to this particular document So wrong, CSS is invented to be applied to multiple documents. Each document can have the _same_ ID attirbute. |
|
They should have a name that describes the elements content. It is about markup, not about styling. |
|
That is stupid. What if your boss wants <p id="green"/> to be 'yellow'? You will have to change the markup in such a case, where it would be better to just describe the content. |
#14
| |||
| |||
|
|
If I want some text to be green, say, for aesthetic reasons without having green text mean anything, then then I'm faced with defining format (or "style" as you put it) of the text itself. That may not be the strength and basic purpose of CSS, but CSS does the job. |
|
In otherwords, what would you substitute for the word "green" if you knew nothing about the paragraph in question? |
#15
| ||||
| ||||
|
|
So wrong, CSS is invented to be applied to multiple documents. Each document can have the _same_ ID attirbute. Well, yes, it is true that two different documents might use the same ID name, but each ID must still refer to a specific instance, as far as I know. |
|
If I want some text to be green, say, for aesthetic reasons without having green text mean anything, then then I'm faced with defining format (or "style" as you put it) of the text itself. |
|
That is stupid. What if your boss wants <p id="green"/> to be 'yellow'? You will have to change the markup in such a case, where it would be better to just describe the content. That's true. But does it not presume the paragraph here has a specific function? |
|
I hope all this does not seem too trivial to worry much about. |
#16
| |||
| |||
|
|
If I want some text to be green, say, for aesthetic reasons without having green text mean anything, then then I'm faced with defining format (or "style" as you put it) of the text itself. That may not be the strength and basic purpose of CSS, but CSS does the job. Why do you want the text green? |
|
For overall good design, making text green should be done for more of a reason than "I felt like it" - perhaps "this text is showing the price of something on sale, so I want it green" is more accurate. Or "this paragraph is a sick joke and should be green in color." So your class or id ought to be "saleprice" or "sickjoke." That way, down the road if the colors ought to change, you're not stuck having your "green" elements being yellow or olive. |
#17
| |||
| |||
|
|
On Wed, 17 Dec 2003, Haines Brown wrote: So wrong, CSS is invented to be applied to multiple documents. Each document can have the _same_ ID attirbute. Well, yes, it is true that two different documents might use the same ID name, but each ID must still refer to a specific instance, as far as I know. Web pages tend to have quite a lot in common. There's no point in inventing a new name for every banner head, for every navigation area, for every copyright notice. And by keeping consistent, you can keep the site looking consistent, and make consistent changes with minimum effort. But you know this already, right? Sure, there will also be items on pages that are not typical of anything found on other pages, but that doesn't stop one from being consistent when it's possible to be consistent. |
#18
| |||
| |||
|
|
whic is a list of links prefaced by an arrow graphic: |
|
p class="links" id="child" img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-a.html">child a</a><br / img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-b.html">child b</a><br / img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-1.html">child 1</a /p Now, let's assume there's a categorical distinction between the child links that are listed alphabetically, and the one listed numerically, and so a want to insert, say 0.4em; padding between the second and third link. What would you recommend? |
#19
| |||
| |||
|
|
But let me raise a practical question. Suppose I have something lke this, whic is a list of links prefaced by an arrow graphic: p class="links" id="child" img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-a.html">child a</a br / img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-b.html">child b</a br / img class="arrow" src="../bin/arrow.png" alt=" " / a href="doc-1.html">child 1</a /p |
|
Now, let's assume there's a categorical distinction between the child links that are listed alphabetically, |
|
and the one listed numerically, and so a want to insert, say 0.4em; padding between the second and third link. What would you recommend? This actually lies behind why I raised the issue in the first place. |
#20
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |