Putting css in an html page.

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.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #21  
Old Feb 7th, 2007, 00:24
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #22  
Old Feb 7th, 2007, 00:29
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Putting css in an html page.

I think we're going to have to agree to disagree here, mreine
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #23  
Old Feb 7th, 2007, 01:08
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Re: Putting css in an html page.

Pistols at dawn?
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #24  
Old Feb 7th, 2007, 05:44
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #25  
Old Feb 7th, 2007, 08:47
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #26  
Old Feb 7th, 2007, 16:02
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Putting css in an html page.

Quote:
Originally Posted by Ryan Fait View Post
After all, class="left" attribute means the same thing as class="style126"
bzzzzz.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #27  
Old Feb 7th, 2007, 21:27
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #28  
Old Feb 7th, 2007, 22:28
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
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:
Originally Posted by Ryan Fait View Post
And they just happen to leave the fundamental purpose of style sheets (to make pages pretty) in tact
Bzzzzz. The fundamental purpose of styles and style sheets are to separate presentation from content. Not just make things pretty.

Quote:
Originally Posted by Ryan Fait View Post
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.
I'm not argueing how you do things, I don't care what you do with your own sites. I care more about proper methods being explained on this site so people don't read your backwards method and think it's the intended way of using style sheets. It is indeed backwards when you have to switch the class name in the html instead of reassigning attributes to the class in the style sheet. Hmmm... switch a class name in 14 pages vs reassigning one attribute in the style sheet ?.... yeah, that's exactly the same and exactly what style sheets were meant for .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, link

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 07:54.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42