X
X
XenK2015-09-24 21:42:50
css
XenK, 2015-09-24 21:42:50

CSS override property how?

There is a menu, it has several items that consist of links. I apply the style to all links that are in the menu:

.dropdown a {
    display: block;
    font-size: 17px;
    line-height: 30px;
    font-weight: 700;
    padding: 18px 20px 12px 16px;
    border-bottom: 3px solid transparent;

But, for the last link, I want to cancel this property, how to do it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Deodatuss, 2015-09-24
@Deodatuss

.dropdown a :not(:last-child)

D
Dmitry Kovalsky, 2015-09-24
@dmitryKovalskiy

.dropdown a:last-child {

}

You can try that.
UPD: Override the properties you need for the last element.

D
Denis Ineshin, 2015-09-24
@IonDen

There is no way to cancel, you can only overwrite with a new one (which, as it were, cancels the previous style).

.dropdown a {
    color: #000;
}
.dropdown a:last-child {
    color: #fff;
}

B
bro-dev, 2015-09-24
@xPomaHx

If such problems arise, then I advise you to read about the specificity of selectors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question