472,143 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

Find all style rules matching an element

Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.
Oct 23 '06 #1
9 2260
Harlan Messinger <hm*******************@comcast.netwrote:
>Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.
Mozilla DOM Inspector?

--
Spartanicus
Oct 23 '06 #2
Spartanicus wrote:
Harlan Messinger <hm*******************@comcast.netwrote:
>Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.

Mozilla DOM Inspector?
Unless I'm overlooking a feature, for a given element the DOM Inspector
only lists the computed style property values, without indicating how it
arrived at them.
Oct 23 '06 #3
Harlan Messinger <hm*******************@comcast.netwrote:
>>Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.

Mozilla DOM Inspector?

Unless I'm overlooking a feature, for a given element the DOM Inspector
only lists the computed style property values, without indicating how it
arrived at them.
That should allow you to establish *if* there is an unexpected property
or value being applied through inheritance or the cascade other than
through the style properties directly attached to the element.

If you then have difficulty establishing which rule causes this, and
this happens frequently enough to be an annoyance, then this suggest
that your stylesheets are to complex.

--
Spartanicus
Oct 23 '06 #4
Spartanicus wrote:
Harlan Messinger <hm*******************@comcast.netwrote:
>>>Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.
Mozilla DOM Inspector?
Unless I'm overlooking a feature, for a given element the DOM Inspector
only lists the computed style property values, without indicating how it
arrived at them.

That should allow you to establish *if* there is an unexpected property
or value being applied through inheritance or the cascade other than
through the style properties directly attached to the element.

If you then have difficulty establishing which rule causes this, and
this happens frequently enough to be an annoyance, then this suggest
that your stylesheets are to complex.
It's more like, different sheets are being provided by different
authorities over different parts of the web page. Unfortunately, the
others didn't wrap their parts of the HTML in a DIV with an ID and then
use that ID consistently to differentiate their selectors.
Oct 23 '06 #5
Harlan Messinger <hm*******************@comcast.netwrites:
Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element,
along with the properties applied in connection with each of them? In
other words, a tool to help identify why a particular element looks as
it does when it isn't consistent with my expectations.
Have you tried the "Web Developer" FireFox extension? It does not do
exactly what you ask, but the live "display element information"
together with "view style information" comes damn close.

--
Ben.
Oct 23 '06 #6
In article <4q************@individual.net>,
Harlan Messinger <hm*******************@comcast.netwrote:
Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.
Does http://www.culturedcode.com/ Xyle scope do what you want?

--
http://www.ericlindsay.com
Oct 23 '06 #7
Eric Lindsay wrote:
In article <4q************@individual.net>,
Harlan Messinger <hm*******************@comcast.netwrote:
>Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.

Does http://www.culturedcode.com/ Xyle scope do what you want?
From "In Cascade Mode all rules from associated style sheets that apply
to the currently selected HTML element and its ancestors are shown in
their proper order known as the CSS cascade" I'd say it sounds like it.
I'll have to check it out. Thanks!
Oct 23 '06 #8
Harlan Messinger wrote:
Eric Lindsay wrote:
>In article <4q************@individual.net>,
Harlan Messinger <hm*******************@comcast.netwrote:
>>Has anyone produced a tool that identifies and lists all the
selectors found among a page's stylesheets that match a particular
element, along with the properties applied in connection with each of
them? In other words, a tool to help identify why a particular
element looks as it does when it isn't consistent with my expectations.

Does http://www.culturedcode.com/ Xyle scope do what you want?
From "In Cascade Mode all rules from associated style sheets that apply
to the currently selected HTML element and its ancestors are shown in
their proper order known as the CSS cascade" I'd say it sounds like it.
I'll have to check it out. Thanks!
Or not! It's for Mac only.
Oct 23 '06 #9
In article <4q************@individual.net>,
Harlan Messinger <hm*******************@comcast.netwrote:
Eric Lindsay wrote:
In article <4q************@individual.net>,
Harlan Messinger <hm*******************@comcast.netwrote:
Has anyone produced a tool that identifies and lists all the selectors
found among a page's stylesheets that match a particular element, along
with the properties applied in connection with each of them? In other
words, a tool to help identify why a particular element looks as it does
when it isn't consistent with my expectations.
OP may find

<http://penguin.theopalgroup.com/cgi-...er/selectoracl
e.py>

useful in tracking down problems when getting a bit confused...

--
dorayme
Oct 23 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by macgyver | last post: by
3 posts views Thread by Michele Locati | last post: by
5 posts views Thread by Andrew Poulos | last post: by
9 posts views Thread by Aaron Gray | last post: by
10 posts views Thread by pamelafluente | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.