Reputation: 79
No matter what i try the padding-right cant be removed using lastchild i tried using imglastchild then lilastchild also last-of-type.
<div class="Social_Media">
<ul>
<li><img src="Social/facebook.png"></li>
<li><img src="Social/twitter.png"></li>
<li><img src="Social/youtube.png"></li>
<li><img src="Social/googleplus.png"></li>
<li><img src="Social/linked.png"></li>
</ul>
</div>
.Social_Media ul{
padding-top:10px;
float:right;}
.Social_Media li{
display:inline;}
.Social_Media img{
padding-right:25px;
background-color:red;
}
.Social_media img:last-child {
padding-right:0px
}
Upvotes: 0
Views: 32
Reputation: 207901
You have multiple typos in the code you posted (see my comment above), however the real issue is that you're selecting the wrong element. Your final selector should be
.Social_Media li:last-child img {
padding-right:0px
}
You need to select the last list item with :last-child
and then the image within it and remove the padding. Using :last-child
on the image would actually apply to every image in your example as they're all the last child of their parent container.
Upvotes: 2