Reputation: 19587
I have this css role
.sf-menu a.sf-with-ul{padding-left:20px}
I want to change this role using jquery
I tried without success the following commands
$(function()
{
$("a.sf-with-ul").css("padding-left", "10px");
$("a").hasClass(".sf-with-ul").css("padding-left", "10px");
$("a").filter(".sf-with-ul").css("padding-left","10px")
});
What is the problem?
p.s
I do I change the roll of this css using jquery?
.sf-menu li ul li a
Upvotes: 1
Views: 55
Reputation: 2639
Try this :
$(function()
{
$(".sf-menu a.sf-with-ul").css("padding-left", "10px");
});
Upvotes: 2
Reputation: 35973
Try to put !important like this:
$(function()
{
$("a.sf-with-ul").css("padding-left", "10px !important");
$("a").hasClass(".sf-with-ul").css("padding-left", "10px !important");
$("a").filter(".sf-with-ul").css("padding-left","10px !important")
});
Upvotes: 0