Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- CSS Coding Standards - Part 2


pageoneresults - 1:45 pm on May 26, 2008 (gmt 0)


<h2 class="red ttu tac fs1-6">your heading</h2>

That's not going to happen. I understand where you are coming from and maybe I need to expand a bit. I of course use styling on core elements. That <h2> is going to be styled from the CSS, not on page.

No, many of my styles have come after the initial design because I was handed something that was the base template and then I needed to add reusable on page classes to get the job done. You're a CSS Designer, I'm not. It took me quite a while to figure out what the heck you had going on with your 3 column template!

I really wish I had someone with me in the beginning to tell me that what I was doing may not have been in my best interests. Truthfully, I've never really encountered any of the issues you are bringing up. Red is a common color used to emphasize something "visually". And yes, I know the apparent challenges in using color to do this.

It's not a CSS "standard" to have to go into the HTML to have to change a style, the whole idea is to keep it separate. so that designers can make any changes necessary.

Ah, a perfect world! Unfortunately it is far from being a reality for many, including myself.

You might know at the start that you want some text to be red, but how can you know that you *might* need that to change to a softer shade of pink once the design is complete because the red is just too harsh? are you coding the design or the markup?

The original design template is pretty much static. It contains all the core elements which have their applicable styles applied. I'm surely not going to do...

<h2 class="red ttu tac fs1-6">your heading</h2>

That's a bit extreme. In fact, I would rarely have a class on a core element like that.

That's what is wrong with your method, you're not separating your team responsibilities according to their job title, you're doing it all, or at least controlling it all.

In my case, I'm providing a core set of classes that can be used "on page" to style additional elements that are not part of the core styles. It happens, and it happens regularly.

I could make your changes at the design level while your programmers do what they do best!

That's the goal and a lofty one at that. If only programmers would do just that, program.

Like I said before your way around you would be as well writing the styles inline because you're doing them at markup time.

Claire, I'm doing them at both design and markup phases just like many others probably are. The initial design will have all of its core styling. But, as that website grows and the design expands, things happen. And, I end up doing things based on my level of CSS and what appears to work well for everyone involved with the projects. We try to keep things "very simple" and you are not going to find many classes assigned to core elements. But, you might find something inline that is styled using one of the "add-on" classes after the design phase.

Of course there's no manual on naming conventions but as with any language there is always best practice guidelines, it's not a best practice guideline to name classes according to function, everyone is free to code to their own style as long as they are the one in charge of their site, which is why it works for you. I would not recommend your method to anyone, even if it works well for you - sorry.

Again, show me a book and/or set of guidelines that "tells me" how to name my Classes/IDs and I'll be a happy camper. We could probably pull stylesheets from the top 50 websites and not find much amongst them that was common, or could we? In this case, I think its one of those "what works best for you" type scenarios. Your level of CSS knowledge is not typical for many teams. Well, you'd probably be writing the guidelines for everyone else. For the rest of us, we need to work with the "norm" and not "a perfect world" example.

CSS allows freedom to the nth degree. How do you standardize something that allows you to achieve the desired results using a multitude of CSS strategies? How?

P.S. You're starting to help me understand my ways may not be the best. Once my hand gets smacked a couple of times I perk up and listen.


Thread source:: http://www.webmasterworld.com/css/3656519.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com