使用 jQuery 更改边框底部颜色?
如何使用 jQuery 更改底部边框的颜色?
How to change the color of the bottom border using jQuery?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何使用 jQuery 更改底部边框的颜色?
How to change the color of the bottom border using jQuery?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
#mydiv
,然后$("#mydiv")
.css()
方法修改指定对象的 css 属性值。#mydiv
, then$("#mydiv")
.css()
method provided by jQuery to modify specified object's css property values.要修改更多CSS属性值,您可以使用CSS对象。比如:
但是如果修改代码比较臃肿。您应该考虑 方法 March 建议的。这样做:
首先,在你的 css 文件中:
其次,在你的 js 代码中:
如果 ie 6 不是问题,你可以链接这些类以获得更具体的选择器。
to modify more css property values, you may use css object. such as:
but if the modification code is bloated. you should consider the approach March suggested. do it this way:
first, in your css file:
second, in your js code:
if ie 6 is not an issue, you can chain these classes to have more specific selectors.
如果你的 CSS 文件中有这个:
和一个 div 例如:
你可以使用:
或者你可以只使用
我更喜欢第一个例子,将所有与 CSS 相关的项目保留在 CSS 文件中。
If you have this in your CSS file:
and a div for instance of:
you can use:
or you can just use
I prefer the first example, keeping all the CSS related items in the CSS files.