I am trying to create a simple box system and I need to remove the right edge of the first child.
I tried both first-child and the first type and still cannot set up the target class correctly.
I have read several different examples and still cannot find a solution.
Please view the fiddle and help me remove the left edge from the first child.
.container { position: relative; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; background-color: black; } .box { margin: 1% 0 1% 0; float: left; background-color: gray; box-sizing: border-box; color:white; } .box.full { width: 100%; margin-left: 0; } .box.half { width: 49%; margin-left: 1%; } .half:first-child { margin-left: 0; }
source share