I am facing an issue when using the :last-child
pseudo selector.
I have the following markup:
<div class="apply_container">
<form class="margin">
<div class="apply_inn border">
<span>Tell me why you want the job?</span>
</div>
<div class="apply_inn">
<span>Some other details</span>
</div>
<div class="apply_inn location">
<span>Apply at a particular location</span>
</div>
<div class="form-actions">
<button type="submit" class="pull-right btn btn-info">
Submit
</button>
</div>
</form>
</div>
And apply these styles:
.apply_container .apply_inn {
border-bottom: 1px dashed #E6E6E6;
margin: auto;
padding: 18px 0;
width: 790px;
}
.apply_container .apply_inn:last-child {
border:none;
}
My goal is to prevent the last div.apply_inn
from being styled with a bottom-border
like the rest of the div.apply_inn
s. The style does not seem to get applied. Can anyone explain what is happening?
Here is the original fiddle of my problem. As well as a simplified fiddle demonstrating the issue.