I'm trying to set a default padding of 15px for div.content, but if it contains a child div.products-list, I want the padding to be removed. I've looked into solutions using jquery, but nothing seems to work. Here's how my layout is structured:
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".products-list").parents("div.content").css("padding", "0");
});
</script>
<style>
.content {
padding: 15px;
}
</style>
</head>
<body>
<div class="content">
<div class="products-list"></div>
</div>
</body>
Any assistance would be greatly appreciated!