Spotting missing styles

G

grant

Not sure if this is possible, but thought I would ask.

Is it possible to somehow check for missing styles in document. I am
thing that if a webpage loads and the style is not in the stylesheet
then something happens. Warning on the page for example.

Any pointers would be appreciated

Grant
 
B

Benjamin Niemann

Is it possible to somehow check for missing styles in document. I am
thing that if a webpage loads and the style is not in the stylesheet
then something happens. Warning on the page for example.

Such a check does (generally) not really make sense. Both the ID and the
CLASS attributes can be used for other purposes than CSS.
Perhaps there is a tool that performs such a check - but the result would
only be useful to people who restricts themselves to have at least one
matching rule in their CSS for every class and id in the document.

CSS is about the (mostly visual) rendering of a document. Programmatically
checking the CSS for correctness (= produces the intended result) is close
to impossible. So you're left with manual testing anyway - if there is a
rule 'missing' the document will not look (or sound) as you intended. I
can't think of a useful way that some piece of software could free you from
such manual checks.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed (e-mail address removed) writing
in
Not sure if this is possible, but thought I would ask.

Is it possible to somehow check for missing styles in document. I am
thing that if a webpage loads and the style is not in the stylesheet
then something happens. Warning on the page for example.

Any pointers would be appreciated

Grant

Bradsoft's TopStyle has the ability to show orphaned classes. You could
check the orphans against the document and perhaps find missing styles
that way. For example, class="something" and .somethng would not match,
and somethng would show up as an orphan.
 
G

grant

What I ended up doing was using JavaScript to get the styles in the
document, and then see if that style is in the stylesheet. Seems to
work.

Grant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top