Nathan Koop
Nathan Koop

Reputation: 25197

Tool to diff two CSS elements

I have two div's that display slightly differently, I have looked through each of their CSS properties and they appear to be the same, however I am wondering if I've overlooked something.

Is there a tool that will basically diff the CSS of two different elements?

Preferably integrated into the browser.

EDIT

I have used Chrome's built in dev tools and gone through the computed styles area and manually compared each property (IE div.A font-weight:normal; div.B font-weight:normal etc...)

I am looking for a tool that essentially says "Select Element A and B", and shoots out a list of differences. Like a Winmerge comparison or something like that.

Upvotes: 34

Views: 10793

Answers (5)

Konrad Dzwinel
Konrad Dzwinel

Reputation: 37913

Similar question was asked here and, as a result, I created a script that compares two elements in Chrome (you will find it in the linked answer). Also, based on said script, I created a handy Chrome DevTools Extension "CSS Diff".

CSS Diff in action

Upvotes: 23

karansheel
karansheel

Reputation: 5

Beyond compare is the tool for comparing css or any kind of file

Upvotes: -3

Sergey Metlov
Sergey Metlov

Reputation: 26331

I am using Code Cola extension for Google Chrome. Very good and powerfull tool. Recomend for everybody.

Upvotes: 0

Perll
Perll

Reputation: 5

div tags sometime behave different with same properties. The reason is your other code may be affecting it. In Firefox you can use firebug. the important thing in my opineon is you need to check the code around divs which is affecting their behaviour.

Upvotes: 0

Saeed Neamati
Saeed Neamati

Reputation: 35852

I think Firediff is what you want. While it doesn't compare two elements, but it kind'of logs DOM changes, so that you can compare those logs to see what's happening.

Also you can go to computed style in Firebug, and copy/paste computed style of each div into a different notepad file, and then compare those files using a file comparison tool. BeyondCompare is really cool.

Upvotes: 3

Related Questions