This is a discussion on "Putting css in an html page." within the Web Page Design section. This forum, and the thread "Putting css in an html page. are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Putting css in an html page.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#21
|
|||
|
|||
|
Re: Putting css in an html page.
I agree 100% Rob, except for the highlighted and sunken. But that's out of context for what sparked the last part of this discussion which is why I didn't go down that path.
Last edited by mreine; Feb 7th, 2007 at 00:27. |
|
#22
|
||||
|
||||
|
Re: Putting css in an html page.
I think we're going to have to agree to disagree here, mreine
|
|
#23
|
||||
|
||||
|
Re: Putting css in an html page.
Pistols at dawn?
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#24
|
|||
|
|||
|
Re: Putting css in an html page.
I don't need a pistol.
The discussion turned in to how to handle a particular situation and the best way to handle that situation is not by defeating the very purpose of a style sheet. I won't let that go uncorrected. I will not agree to disagree with you Ryan, because what you are doing is ruining the entire concept of a style sheet and that may be fine for you, but it's not a good recommendation in general. Notice I said "A better choice would be" and not "The only way to do it would be". My better choice was in line with what was being discussed, which was how to handle those unique situations without limiting your options completely and still keeping the purpose of the style sheet intact. The best overall choice for class names are to avoid limiting styling factors and try to describe the purpose/structure of the element. IE.. hdr or header, intro, content, nav or navigation, ftr or footer, news. These can be styled any way possible, without changing the html, and still maintain their clarity as to what each one does without a lot of back and forth referencing. It's just cleaner, better and in keeping with the entire purpose of what a style sheet is. |
|
#25
|
||||
|
||||
|
Re: Putting css in an html page.
Don't get me wrong, I'm the first to say I use .wrapper, .content, .nav, .date or .title where possible. But I also use things like .code, .left and .right. I'm certainly not doing things like .bigRed22pxFontSizeBoldHeaderLeftTop20pxPadding. I think for small to medium sites, giving meaningful names to some things certainly doesn't ruin the entire purpose of style sheet. It makes the task of site maintence and page additions less of a pain. If I want something floated to the left, I simply use class="left"; I don't need to hunt through a long style sheet in search for what may be .style126.
I understand exactly what you're saying, but you're blowing this thing way out of proportions here. After all, class="left" attribute means the same thing as class="style126" if CSS isn't there to style it: it's still complelety separate. |
|
#26
|
|||
|
|||
|
Re: Putting css in an html page.
Quote:
class="left" means if you reassign it to float right, the tag makes absolutely no sense now. You will have to change the html tag to another class called right. You shouldn't have to change classes all the time. You call this less maintanence? class="style126" means you can reassign it as whatever you want and it still makes sense. Maybe not as much sense as "column1", but it's better then "left". There is a need for misc classes, no question about this, but at the same time, if you have 126 misc named classes, you should reconsider how you are referencing your elements. Are you using pseudo's and such? Don't take just my word for it.... Here is a good reference to class names and why http://builder.com.com/5100-6371-5286783.html |
|
#27
|
||||
|
||||
|
Re: Putting css in an html page.
You know exactly what I mean. And yes, in my working experience, it takes a considerable amount of time out of maintenance and page additions by using easy-to-remember class names. Continue to argue as you like, but I've got my way of doing things. And they just happen to leave the fundamental purpose of style sheets (to make pages pretty) in tact while simultaneously increasing productivity.
This discussion has made me realize that there is no pressing need for absolute separation of the structure and presentation, and I'll no doubt continue to use class names that are meaningful. |
|
#28
|
|||
|
|||
|
Re: Putting css in an html page.
That's right... you have YOUR way of doing things and it works for YOU and meets YOUR acceptance level of maintenance. That doesn't mean it's the intended way.
Quote:
Quote:
|
![]() |
| Tags |
| css, link |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Putting C# into an ASP.NET Page. | alexgeek | ASP.NET Forum | 2 | Feb 5th, 2008 17:16 |
| [SOLVED] Putting CSS with an HTML Table. | mcdanielnc89 | Web Page Design | 6 | Nov 2nd, 2007 05:13 |
| A better way putting a menu bar, on every page | Joolsd186 | Web Page Design | 36 | Nov 3rd, 2006 07:29 |
| Putting PHP in your web page | Jodi | PHP Forum | 13 | Jan 10th, 2005 20:50 |