Use Firebug to Get a Deep Copy of CSS in Elements

I use Firebug to check web page elements. There is a style tab on the right side of the page, listing all the CSS styles for this tag. These CSS styles come from the linked CSS page.

What I want to do is somehow copy the set of divs with CSS encoded in the div. That way I can copy and paste elements and have the same style. Is it possible to do this with Firebug or perhaps with another tool?

+6
css firebug
source share
3 answers

I do not know about Firebug, but you can create a script to do this.

List the CSS that you want to copy (each property that you think is necessary for its portability), and then loop through JS and getComputedStyle() . Then create a list ; delimited by property:value and assign it to the style attribute if your element and all children are.

This does not seem like an easy task - and you will undoubtedly run into problems.

+1
source share

I used IE9 to accomplish this.

  • Open the page where you want to capture style in IE9
  • Press F12 to display the developer toolbar.
  • On the developer's toolbar, click "Find" and select "Select an item with a click."
  • Then go to "View"> "Source" and select "Source Element with Style"
+7
source share

I'm not sure what exactly you are trying to do here, but are you trying to apply the same style to multiple elements (divs)? If so, you should use the css class. So your html will be

 <div class="myClass"></div> <div class="myClass"></div> <div class="myClass"></div> 

and css will be

 .myClass { height:whatever; width:whatever; etc } 
-one
source share

All Articles