开发者

How to get the CSS style from Inspect Element

Is any tool / extension out there that helps me generating the CSS signature or style

For example:

I see a HTML object and I want to change it, I right click on my Browser ( Chrome, Firefox ) and I choose to inspect the element, there I will be able to modify any css attribute "live". Sometimes it's difficult to know which style signature would correspond to the recent changes.

element.style {
background: none;
}

My question is if there is any tool that tells you what element.style correct name would be., I think may be multiple results per style though...

I'm already using Chrome Firebug like tools. Some elements have no style defined so it appears element.style by default when Inspecting the element. There I can start editing to see how changes would effect.

What I'm asking for is for some too开发者_运维百科l to change this default style name: "element.style" to a whole correct path for example: .superior_div_class #the_element_you_want_to_edit


In Firebug for Firefox, you can inspect an element as you describe, and then copy either the XPath or Css Path. This gives you the entire path you need right from html down to the specific element.

How to get the CSS style from Inspect Element

For example say you are inspecting a link with id myLink. You can copy the Css Path to get something like:

html body form table.myTable tr td a#myLink


If you're using chrome or firefox you can just click in the html and click edit and then give a class or id to the html element and it updates it live.

How to get the CSS style from Inspect Element


In Chrome, in 'inspect element", on the top where "element" and "console" are highlighted, click source and look through the nested files for the element you are looking for. I think as of today HTML files are color-coded white and CSS files are yellow, but that may change.

How to get the CSS style from Inspect Element


  • In Chrome, just hit Ctrl+Shift+I to bring up the developers tools
  • In IE8+ hit F12
  • In Firefox install the Firebug extension.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜