【发布时间】:2017-08-23 13:31:44
【问题描述】:
我有以下css:
.pageMenu .active::after {
content: '';
margin-top: -6px;
display: inline-block;
width: 0px;
height: 0px;
border-top: 14px solid white;
border-left: 14px solid transparent;
border-bottom: 14px solid white;
position: absolute;
right: 0;
}
我想使用 jQuery 更改顶部、左侧和底部边框的边框宽度。我用什么选择器来访问这个元素?我尝试了以下方法,但似乎不起作用。
$('.pageMenu .active:after').css(
{
'border-top-width': '22px',
'border-left-width': '22px',
'border-right-width': '22px'
}
)
【问题讨论】:
-
你不能通过 JQuery,但你可以通过 JavaScirpt(访问 CSS 规则)stackoverflow.com/questions/15087736/…
-
@AliBassam 你刚才说的话毫无意义。 jQuery IS Javascript(实际上是它的约定库,但我希望你明白这一点)。
-
这是一个具有多种选择的绝佳解决方案,包括以下@blazemonger:stackoverflow.com/questions/5041494/…
标签: jquery css jquery-selectors