By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,929 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,929 IT Pros & Developers. It's quick & easy.

any utility to list undefined CSS classes?

P: n/a
Is there a way to see what CSS classes in a page are not defined? (like
if I want to find mispelled class names, etc)

Sep 7 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Art
On 9/7/06 9:41 AM, wo******@gmail.com wrote:
Is there a way to see what CSS classes in a page are not defined? (like
if I want to find mispelled class names, etc)
Try using the W3C CSS validator at:

http://jigsaw.w3.org/css-validator/

It has input options for either file or pasting of the css source of
interest.

There's an equivalent for HTML at:

http://validator.w3.org/

HTH...

Art
Sep 7 '06 #2

P: n/a

Art wrote:
On 9/7/06 9:41 AM, wo******@gmail.com wrote:
Is there a way to see what CSS classes in a page are not defined? (like
if I want to find mispelled class names, etc)
Try using the W3C CSS validator at:

http://jigsaw.w3.org/css-validator/

It has input options for either file or pasting of the css source of
interest.

There's an equivalent for HTML at:

http://validator.w3.org/

HTH...

Art
Hmm... maybe I didn't check the correct option, but I tried it, and one
said the HTML is valid (it syntactically is I guess) and the other said
the CSS is valid (hundreds of warnings about classes not defining
background colors and stuff though)... but none of the options I tried
would tell me that 'yomomma' was not defined for '<div class="yomomma">'

Sep 7 '06 #3

P: n/a
wo******@gmail.com wrote:
>Art
Hmm... maybe I didn't check the correct option, but I tried it, and one
said the HTML is valid (it syntactically is I guess) and the other said
the CSS is valid (hundreds of warnings about classes not defining
background colors and stuff though)... but none of the options I tried
would tell me that 'yomomma' was not defined for '<div class="yomomma">'
Your question wasn't clear. Classes aren't "defined". You can designate
classes for elements in your HTML document. In CSS, you can associate
styles with none, some, or all of the classes you have used in your HTML
document, as well as with classes that you may not have used at all in a
particular HTML document.

I think what you're asking is whether, *assuming* that the only reason
you're assigning elements to classes is to have styles applied to them,
you want a list of classes that have been assigned but that are not
referenced in any of the selectors in any of the stylesheets linked to
your document. This will reveal any classes that you have either
mistyped or neglected to style. Is that it?
Sep 7 '06 #4

P: n/a

Harlan Messinger wrote:
wo******@gmail.com wrote:
Art
Hmm... maybe I didn't check the correct option, but I tried it, and one
said the HTML is valid (it syntactically is I guess) and the other said
the CSS is valid (hundreds of warnings about classes not defining
background colors and stuff though)... but none of the options I tried
would tell me that 'yomomma' was not defined for '<div class="yomomma">'

Your question wasn't clear. Classes aren't "defined". You can designate
classes for elements in your HTML document. In CSS, you can associate
styles with none, some, or all of the classes you have used in your HTML
document, as well as with classes that you may not have used at all in a
particular HTML document.

I think what you're asking is whether, *assuming* that the only reason
you're assigning elements to classes is to have styles applied to them,
you want a list of classes that have been assigned but that are not
referenced in any of the selectors in any of the stylesheets linked to
your document. This will reveal any classes that you have either
mistyped or neglected to style. Is that it?
Exactly. Many times I found that I typed something like <div
class="Productheader"but the class in the css as I wrote it was
..productheader {...} (lowercase P). Sometimes it's obvious, but
sometimes it is not. Was hoping there was some utility or something
that would tell what classes weren't found in the style sheets applied.

Sep 7 '06 #5

P: n/a
In article <11**********************@i3g2000cwc.googlegroups. com>,
wo******@gmail.com wrote:
Harlan Messinger wrote:
wo******@gmail.com wrote:
>Art
Hmm... maybe I didn't check the correct option, but I tried it, and one
said the HTML is valid (it syntactically is I guess) and the other said
the CSS is valid (hundreds of warnings about classes not defining
background colors and stuff though)... but none of the options I tried
would tell me that 'yomomma' was not defined for '<div class="yomomma">'
Your question wasn't clear. Classes aren't "defined". You can designate
classes for elements in your HTML document. In CSS, you can associate
styles with none, some, or all of the classes you have used in your HTML
document, as well as with classes that you may not have used at all in a
particular HTML document.

I think what you're asking is whether, *assuming* that the only reason
you're assigning elements to classes is to have styles applied to them,
you want a list of classes that have been assigned but that are not
referenced in any of the selectors in any of the stylesheets linked to
your document. This will reveal any classes that you have either
mistyped or neglected to style. Is that it?
Exactly. Many times I found that I typed something like <div
class="Productheader"but the class in the css as I wrote it was
.productheader {...} (lowercase P). Sometimes it's obvious, but
sometimes it is not. Was hoping there was some utility or something
that would tell what classes weren't found in the style sheets applied.
The reverse would also be nice - a utility that would list classes
in a linked sylesheet that are not actually used by the document in
question.

Is there such a beast?
Sep 7 '06 #6

P: n/a

David Stone wrote:
In article <11**********************@i3g2000cwc.googlegroups. com>,
wo******@gmail.com wrote:
Harlan Messinger wrote:
wo******@gmail.com wrote:
>
Art
Hmm... maybe I didn't check the correct option, but I tried it, and one
said the HTML is valid (it syntactically is I guess) and the other said
the CSS is valid (hundreds of warnings about classes not defining
background colors and stuff though)... but none of the options I tried
would tell me that 'yomomma' was not defined for '<div class="yomomma">'
>
Your question wasn't clear. Classes aren't "defined". You can designate
classes for elements in your HTML document. In CSS, you can associate
styles with none, some, or all of the classes you have used in your HTML
document, as well as with classes that you may not have used at all in a
particular HTML document.
>
I think what you're asking is whether, *assuming* that the only reason
you're assigning elements to classes is to have styles applied to them,
you want a list of classes that have been assigned but that are not
referenced in any of the selectors in any of the stylesheets linked to
your document. This will reveal any classes that you have either
mistyped or neglected to style. Is that it?
Exactly. Many times I found that I typed something like <div
class="Productheader"but the class in the css as I wrote it was
.productheader {...} (lowercase P). Sometimes it's obvious, but
sometimes it is not. Was hoping there was some utility or something
that would tell what classes weren't found in the style sheets applied.

The reverse would also be nice - a utility that would list classes
in a linked sylesheet that are not actually used by the document in
question.

Is there such a beast?
Oh yeah! that would be great too! I'm sure there are a bunch of unused
styles in my stylesheets

Sep 7 '06 #7

P: n/a
wo******@gmail.com wrote:
David Stone wrote:
>In article <11**********************@i3g2000cwc.googlegroups. com>,
wo******@gmail.com wrote:
>>Harlan Messinger wrote:
wo******@gmail.com wrote:

>Art
>Is there such a beast?
Oh yeah! that would be great too! I'm sure there are a bunch of unused
styles in my stylesheets
Have a look at TopStyle that has a Trial Download.
http://www.newsgator.com/NGOLProduct...rodID=TopStyle

Louise
Sep 7 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.