如何从Inspect Element获取CSS样式 [英] How to get the CSS style from Inspect Element

查看:141
本文介绍了如何从Inspect Element获取CSS样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有工具或扩展程序可以帮助我生成CSS签名或样式

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

例如:

我看到一个HTML对象,并且想要更改它,我右键单击我的浏览器(Chrome,Firefox),然后选择检查该元素,在那里我将能够修改任何实时" css属性.有时很难知道哪种样式签名将与最近的更改相对应.

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;
}

我的问题是,是否有任何工具可以告诉您element.style正确的名称是什么.我想每种样式可能会有多个结果...

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...

我已经在使用类似Chrome Firebug的工具.某些元素未定义样式,因此在检查元素时默认情况下会显示element.style.在这里,我可以开始进行编辑,以查看更改的效果.

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.

我要的是寻找一些工具来将此默认样式名称"element.style"更改为完整的正确路径,例如:.superior_div_class #the_element_you_want_to_edit

What I'm asking for is for some tool to change this default style name: "element.style" to a whole correct path for example: .superior_div_class #the_element_you_want_to_edit

推荐答案

在Firefox的Firebug中,您可以按照说明检查元素,然后复制XPathCss Path.从html到特定元素,这将为您提供所需的完整路径.

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.

例如,假设您正在检查ID为myLink的链接.您可以复制Css路径来获得类似以下内容的信息:

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

这篇关于如何从Inspect Element获取CSS样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆