Text Decoration Override SCSS

User
a {
color: $primary;
text-decoration: none;
transition: color 0.3s ease, text-decoration 0.3s ease;
display: inline-block;

&:hover {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}

&:visited {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}

&:active {
color: $primary;
text-decoration: underline;
//border-bottom: 1px solid $primary;
}
}
prevent text-decoration underline for elementor-button-wrapper a

Zu unseren Services

Assistant
To prevent the `text-decoration: underline;` from affecting links inside `.elementor-button-wrapper`, you can add a more specific rule in your SCSS:

### Solution:
Modify your SCSS to exclude `.elementor-button-wrapper a` from inheriting the underline styles.

#### **Updated SCSS**

a {
    color: $primary;              
    text-decoration: none;      
    transition: color 0.3s ease, text-decoration 0.3s ease;
    display: inline-block;

    &:hover,
    &:visited,
    &:active {
        color: $primary;
        text-decoration: underline;
    }

    // Prevent text-decoration on elementor buttons
    .elementor-button-wrapper & {
        text-decoration: none !important;
    }
}

### **Explanation:**
– The `text-decoration: none !important;` inside `.elementor-button-wrapper &` ensures that any “ inside `.elementor-button-wrapper` won't get underlined.
– `&` refers to `a` inside `.elementor-button-wrapper`, making it a more specific rule.
– The `!important` overrides any conflicting styles that might be applied elsewhere.

This will ensure regular links behave as expected, while Elementor buttons remain free of underline styles. ๐Ÿš€

Leave a Comment

Your email address will not be published. Required fields are marked *