Talk:Cascading Style Sheets/Archive 2

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Archive 1 Archive 2 Archive 3

CSS Experiments

It seems to me that recently web designers are starting to add sections to their site dedicated to documenting all their experiments with CSS. Examples include:

I'm going to add a section about it, but I want it to be edited by someone with more experience or even removed entirely if it's not apropriate. --Wranga 10:46, 23 Nov 2004 (UTC)

Recent deletions

Hoary wrote: It's poor practice either to set the size of P (other than in particular CLASSes or IDs) or (other perhaps than for pages) to use point sizes

Dear Hoary

In what sense are these 'poor practice'? Do you mean from an accessibility point of view, for the visually impaired? Do you mean from the point of view of maintenance of a large web site with many stylesheets? I think it would have been more helpful if you had explained the problems that these practices will lead us into rather than just deleting them as 'poor practice'. Is this your opinion only, or do you have some evidence that these are bad practices in CSS? (I'm not getting at you, I'd like to know :-) --Nigelj 09:21, 6 Jan 2005 (UTC)

Nigelj, yes, I suppose I should have explained here: somehow I mustered the energy to make the change but not enough to explain it fully, instead, making rude noises in the edit summary (and as you saw, I've been politely rapped over the knuckles today for other, worse examples of the same bad behavior).
Well, let's turn to your question. I meant that either (i) using point sizes (for screen, or all media) or (ii) setting the size of the lettering as a whole was poor practice from the point of view of accessibility. (It has nothing to do with maintenance.) I didn't mean that it should never be done, but I did mean that people should think thrice before doing it -- or perhaps to put it in a different way they shouldn't rush to think of CSS as a gee-whiz energy-saving 21st-century way of implementing all the bad old things they'd previously been doing with the dreaded FONT tag.
Clearly a lot of pages present a lot of text, which, it's assumed, people will read or at least skimread through. Let's put Lynx and the like aside: with every combination of computer, video card, monitor, OS and mainstream browser, we can set our preferred sizes for this. I set mine; you set yours; each of us is his own best judge of the best setting. Yes, with Mozilla, Konqueror and perhaps other browsers we can adjust this with Ctrl-plus-or-minus, but we shouldn't have to. And of course we can have stylesheets on the receiving end: perhaps you and I do, but Joe Bloggs and Josephine Blow can't be expected to know about this. By all means put legalese in small lettering and warnings of deadlines in large lettering, but you'd better have a very good reason before changing the lot . . . which is not merely my personal opinion but also the principle expounded in Let Users Control Font Size and elsewhere.
When you do want to specify sizes, how should you do it? In the article I've just cited, Nielsen says: Do not use absolute font sizes in your style sheets. Code font sizes in relative terms, typically using percentages such as 120% for big text and 90% for small text. Good. But then he continues in a way that surprises me: Make your default font size reasonably big (at least 10 point) so that very few users have to resort to manual overrides. As I've explained, I see no reason why the default font size should be specified at all. And if it is specified, I don't see that point sizes are a good way to do it. As John Pozadzides and Liam Quinn say in the section on font-size in their excellent CSS1 Properties page, Absolute lengths (using units like pt and in) should be used sparingly due to their weakness in adapting to different browsing environments -- 10pt on the monitor I'm staring at now may be quite different from 10pt on the one you're staring at.
All in all I shouldn't have said "poor practice" but rather something like "often undesirable". These aren't rules; they're principles -- principles that I subscribe to, at least. If we're giving examples, I think it's better to keep them uncontroversial unless we have a good reason not to.
I hope I've made the reasons for my changes clear, and perhaps even persuasive. But feel free to get at me. (Or simply revert, of course!) Hoary 12:56, 2005 Jan 6 (UTC)
Thanks for that, Hoary. Very interesting. Maybe, one day, one of us or someone else will have the time and the energy to put some or all of that onto the page. --Nigelj 13:42, 6 Jan 2005 (UTC)
Thanks for the kind words, Nigelj, but I don't think that this would be a good idea.
For one thing, to judge by the number of sites written by apparently knowledgable people, there's a sizable minority (perhaps even a majority) who seem to think that people's default settings are too big and must be made smaller. Well, possibly. It could be said that so many fonts reduce the font size that people must keep it big in order that it will still be legible when reduced. The more I think of this, the sillier it seems, and I'm not sure that I could write it up with a NPOV. Anyway, it would require space.
Again, Wikipedia isn't supposed to be a howto compendium. I believe that there's a Wikisomethingelse for that -- and anyway there are plenty of other excellent howtos available, some of them linked from this very article.
Obviously if there's something I've said that seems particularly worthwhile, anybody is free to stick it in. -- Hoary 01:53, 2005 Jan 7 (UTC)

CSS with PHP

I think something should be added about using CSS with PHP. From what I know, you can control styles for PHP based chat rooms, forums etc. directly in the PHP document. If you use another CSS style sheet it supposedly messes up formatting for the PHP script. I am not a PHP user, so I will not add this. However, I am very experienced in CSS. If anyone can, please add something on this. --Zeerus 17:06, Apr 6, 2005 (UTC)

That's often a result of poor separation of content and presentation; though you can preprocess CSS with PHP and include stylesheets conditionally with the program logic. Are you thinking of something more elegant than those old hacks? b0at 22:55, 6 Apr 2005 (UTC)
No, that's what I was thinking. I wouldn't really consider them hacks, because the CSS and PHP don't require any special tweaking or anything. I'll talk to my company's PHP developer to see what he knows about it. He's the one that originally brought the subject up. Anyway, thanks for the info. I'll get back to you on that last part. --Zeerus 18:01, Apr 7, 2005 (UTC)
I don't quite understand what you're getting at here, but I don't think you entirely understand what PHP is. PHP is a scripting language regularly used to generate content such as HTML pages and CSS on a server before it is sent to the client (in simple terms). By the exact same theory, you could use ASP or even a client-side scripting language such as Javascript to generate a CSS page. If you use inline styles in your PHP-generated HTML (like in any HTML), linking another CSS style sheet may cause undesired effects. AFAIK, PHP has no special feature in this regard that separates it from any other server-side scripting language. If I'm off the mark, I apologise. - Rushyo 21:01, 22 January 2007 (UTC)

Safari "full" CSS2 support?

This got to be a joke. Does it support paged media? @font-face? Aural (though deprecated in CSS2.1 and replaced with vocal module in CSS3)? P.S. Update comparison of layout engines (CSS) if someone know the details. --minghong 09:48, 10 May 2005 (UTC)

It's a mistake, innacurate but not without basis in fact. Safari was the first browser to pass the Acid2 test that the Web Standards Project put together. Slashdot story. It doesn't test full CSS2 compliance, but it's an important benchmark. The controversy over KHTML's collaboration with Safari's code is way more complex than the edit made it out to be. Dave Hyatt (Safari developer) blogged the last few changes that needed to be made to Safari (specifically, to a component in Safari) to get it to pass Acid2) here. (Well, scroll back to mid-April and you'll see the beginning of it.) grendel|khan 21:21, 2005 May 10 (UTC)
As far as I know, the Acid2 patches are not applied to Safari 2.0/1.3. So it is rather meaningless to mention it yet. --minghong 11:29, 13 May 2005 (UTC)

Introductory statement to the subject for non-web-inner-workings-literate newbies?

Can someone provide a very clear sentence or two near the beginning for those non-web programming savvy people like me? Granted, the article does state that the essence of CSS is that it allows both web readers and writers to style pages their own way, but when I was completely new to the subject, I had a hard time with the syntax and would have benefited from a stripped down example. I did eventually find it in the many, many CSS tutorials on the web, but it would be nice if this article could use the inverted pyramid article style of newspapers to state the gist of the subject clearly in the first line or two. Thanks. Spalding 16:45, May 29, 2005 (UTC)

Let me try this on for size, proposed to add at the end of the introduction. "A CSS statement consists of a selector that selects an HTML element to work on, and an action that specifies what to do to it after it finds it, much like an IF statement in any computer programming language. Spalding 19:22, Jun 20, 2005 (UTC)
The trouble is - and I know it's a bit technical to say so - that CSS is a declarative language and so comparisons with control flow and if statements is probably more confusing than helpful as a introduction for newbies - who might end up becoming experts one day if we don't muddle the foundations of their understanding. How about, "Each CSS selector applies aspects of style to some part of an HTML or XML document. In a visual rendering these may set the element's font, colour, layout etc. Because HTML and XML describe hierachically structured information, one selector may apply to large or small parts of a whole document." ? --Nigelj 21:17, 20 Jun 2005 (UTC)
I think the last sentence of my suggestion is definitely optional. --Nigelj 21:19, 20 Jun 2005 (UTC)
That sounds pretty good to me, Nigelj - thanks! Do you want to add it in? Spalding 00:59, Jun 21, 2005 (UTC)

W3C spec documents are fundamental references

Once again the fundamental W3C documents that define CSS and how to use it correctly have been removed from the References section, this time by user:Rufous on the basis of "duplicate links and redundancy". I fail to see how we can leave these out of the References section of such an article; that leaves us with a crib-sheet and a cheat-sheet on some private web sites as our primary references!

This is a level of dumbing-down that I don't think is acceptable for an encyclopedia, but I dont want to get into a personal edit-war over it.

Here are the links I put in a short time ago (for reference ;-):

--Nigelj 20:20, 2 October 2005 (UTC)

Cascading_Style_Sheets#References? ¦ Reisio 00:16, 3 October 2005 (UTC)

Pseudo element notation

Shouldn't we be using the '::' notation for pseudo elements instead of ':'? CSS3 Selectors module says that only pseudoelements defined in CSS2(.1) can take the ':' notation and should be referred to using '::' - all new pseudo elements must use '::'. CSS2 and CSS3 Selectors are both candidate recommendation level so I don't see any reason to use the old style. Robin Whittleton 13:09, 26 October 2005 (UTC)

None of the new pseudo-elements are mentioned on this page yet that I'm aware of — which is fine, since support is just about nonexistent and CSS3 Selectors is a candidate recommendation (not, as you said, the same status as CSS2, which is a full recommendation). It would be premature, I think. ¦ Reisio 22:01, 26 October 2005 (UTC)
Indeed. While textual pseudo elements like ::first-line are somewhat supported, it would be needless to add this to the article at present. Eventually a full CSS Selectors page will be written, and the info can go there. Rufous 22:38, 26 October 2005 (UTC)

I'll refer you to Hixie's blog where he explains that the old 'REC' level is equivalent to today's 'CR'. Actually, since that entry 2.1 has dropped back to Working Draft anyway. Regardless of this, it makes sense to differentiate pseudoelements and pseudoclasses, and a different syntax points that out to newcomers to CSS. Robin Whittleton 23:10, 26 October 2005 (UTC)

The old REC level may be equivalent to today's CR, but that means there's a new REC level (as other things of the same approximate age as CSS3 Selectors are marked REC). Even with that aside: Hixie does not run the W3C (or manage the official naming of specs, either, apparently), CSS3 Selectors is not a REC, the most popular browsers in the world do not support the new pseudo-elements yet, and as the spec itself says, usage of a single colon is fine for the existing CSS1 & 2 pseudo-elements. ¦ Reisio 00:44, 27 October 2005 (UTC)

Move from CSS to XCSS

The step is done from DTD the XSD. Is now the next logical step to move to a XML based style sheet language?

See discussion on: CssVsXcss

Idea for the lead paragraphs

I think the first lead paragraph does a good job of laying out specifically what CSS does, but I think the first sentence of the Overview ("CSS is used by both the authors and readers of web pages to define colors, fonts, layout, and other aspects of document presentation.") should be moved into the lead to help punch up the lead as a whole. The reason I don't just do this is that I'm not sure how to rework the beginning of the Overview. The lead currently only mentions that CSS can be used for presentation once and doesn't really mention what that entails. I just don't think the lead currently fits WP:LS --Rballou 22:11, 14 August 2006 (UTC)


what is wcss? Mathiastck 01:10, 23 August 2006 (UTC)

WP:RD ¦ Reisio 18:06, 23 August 2006 (UTC)
I think it is WAP CSS. I don't know for a fact though. --Rballou 19:19, 23 August 2006 (UTC)


articles about divitis and classitis were removed with intention to be merged with css article. So far there's noting about it here.

EL Cleanup

It's time to do some housekeeping of this article's external links section. As WP:SPAMHOLE mentions, "When the external links section is broken down into subsections, you know something is seriously wrong". I've started by removing a link that has been admittedly spammed here (see [1]). --AbsolutDan (talk) 12:52, 9 October 2006 (UTC)

I'm about to do a major culling of external links as what's here is outrageous - over 60 links with the vast majority repetitive and unencyclopaedic. I'm suggesting we start again and scrutinise every new link before its added. No doubt they'll be howls from the website owners, but I'd like to hear a justification for each before its added. Read WP:EL and remember that this is an encyclopaedia and not a Google replacement - there's no justification for lists of links to tutorials and tools in an encyclopaedia. -- Moondyne 14:56, 17 October 2006 (UTC)

Reply to EL Cleanup

I had added a link to cssmate[2] which is a free online CSS editor. It is intended to give people an easy and instant practical experience with CSS. Maybe you'll call me the first howling site owner but I partially disagree with your statement “there's no justification for lists of links to tutorials and tools in an encyclopedia”. I use an encyclopedia for a brief introduction to the topic and use the references and external links to acquire more detailed information. So I do expect links to tutorials and - especially in case of web technologies – to online tools where applicable. Compared to thousands of matches for “css tutorial” and “css tool” I get in search engines 60 commented links appear of value to me. As the “External links” section is the very last it doesn’t matter to much how long it is. As long as the content of the sites matches the description people can decide themselves to use them.
What do you think?
SESchreiber 21:01, 22 October 2006 (GMT)

  • External links are supposed to be used sparingly. In a case such as we have here, where a topic is so broad that it could have many relevant (and even arguably useful) links, we prefer to link to a single directory (such as DMOZ), which could then list numerous other sites for a reader to follow. I have just done this. --AbsolutDan (talk) 21:40, 22 October 2006 (UTC)
  • The DMOZ directory is an excellent resource where acredited editors review links to go into the directory. Substandard links are not accepted and good links are categorized by people experienced in the field. This is surely a good thing for the end user and we should foster its growth. Your link may be a useful website, but plonking it here only only invites others to do the same and that damages Wikipedia in a real way. — Moondyne 02:06, 23 October 2006 (UTC)

Thanks for your comments. I agree that a deep link to the DMOZ category is a better solution (my site is listed there). In addition I suggest adding deep links to social book marking sites like[3] or[4] (my site won’t be found there). This would help less experienced users to find additional resources by popularity (not only by expertise like in DMOZ). Limiting the external links section to the DMOZ categories and a view other link collections could be a clear standard, keep the section small and still provide the users with the information.
SESchreiber 07:23, 23 October 2006 (GMT)

References, Further reading, External links

What is the criteria to list Cascading Style Sheets, designing for the Web under external links and not under further reading?
Why is CSS home page at W3C listed under references and under external links?
Why are references numbered and the other link sections are bulleted?
--SESchreiber 06:30, 23 October 2006 (UTC)

Import vs. link ref

What's the difference between the two? The article just states that they are equivalent, but on [5], I found:

Many people use both. The reason is that linking one style sheet and then importing the next does two things:

1) Import integrates the stylesheet into the prvious stylesheet, so that they do not override each other if they both cover the same elements.

2) adding the link first prevents the page from first loading a non-CSS layout of the webpage first, then loading the CSS-layout. Works especially well in IE... at least, that is what several of the websites are saying out there Posted by Sean on April 11, 2005 06:51 PM 04:27, 11 November 2006 (UTC)

WP:RD ¦ Reisio 19:22, 11 November 2006 (UTC)

Default Lays on myspace

how do you make default layouts????

WP:RD ¦ Reisio 09:39, 22 November 2006 (UTC)

perhaps you mean custom layouts? i recommend 04:17, 7 June 2007 (UTC)

Difficulty with Adoption of CSS

The article says "it is widely accepted that IE has the worst..."

I happen to disagree with that statement. Also, the release of IE 7 has likely eliminated the author's worries. It's difficult to say, however, exactly what those concerns are since no specifics were given. Is this just another example of fashionable Microsoft bashing? —The preceding unsigned comment was added by (talk) 09:28, 25 February 2007 (UTC).

links colors

Is there anyway to use this color/font changing system to change the colors of the links on wikipedia? it would be quite useful in the case of my userpage, where blue isn't reflected so good.  scrumshus Talk to me 23:29, 14 December 2006 (UTC)

"Further reading"

I'm unclear as to why we need links to authors' web sites if we have ISBN links. In most cases, this is just to promotional material. Yes, I know the sites also have errata and sample code, but it seems folks can get plenty of that by using the link in the external links section.

Before I just started hacking away, I though I'd raise the issue here first. --A. B. (talk) 20:51, 8 January 2007 (UTC)

Hidden .swf in article?

Some type of hidden .swf spam? I reverted. —The preceding unsigned comment was added by ThreeDee912 (talkcontribs) 02:40, 15 January 2007 (UTC).

What is a personal CSS?

There was a mention of this here, but this main CSS article doesn't mention how personal CSSes relate to Wikipedia. It would be cool if someone in the know could help. Kennard2 09:07, 13 March 2007 (UTC)

There is no such thing, but they probably mean user stylesheets. They are stylesheets the user can install in their browser to overrule author stylesheets (author stylesheets are those in webpages). Carewolf 09:54, 13 March 2007 (UTC)
Compicated. Kennard2 03:31, 2 April 2007 (UTC)

Should this be added to external links CSS category? It is a comprehensive list of the best CSS websites, blogs, etc.—Preceding unsigned comment added by Stokelake (talkcontribs)

Looks new and untested. It's unclear who maintains the list or whether it will be well maintained. You also seem to have mass added the dfinitive site to a lot of articles (which is spamming Mass added and spam accusations are hyperbole on my part, I'm sorry, and I take this back) - So no. It doesn't look like a good addition. -- Siobhan Hansa 18:54, 10 April 2007 (UTC)