Home CSS - Styling child element if parent has ::before
Reply: 0

CSS - Styling child element if parent has ::before

user1786
1#
user1786 Published in April 21, 2018, 3:30 pm

I'm calling and styling a link with class 'myCheckboxLink' like this:

css:

table.table-custom tbody td a.myCheckboxLink {
    /* styling */
}

html:

<table id="custom" class="display table-custom dataTable">
    <thead></thead>
    <tbody>
        <tr id="row_33" role="row" class="odd">
            <td class=" dt-checkbox" tabindex="0">
                <a class="myCheckboxLink" tabindex="0">
                    <span class="myCheckboxSpan">
                        <i class="fa fa-check fa-check-checkbox" aria-hidden="true"></i>
                    </span>
                </a>
            </td>
        </tr>
    </tbody>
</table>

If td.dt-checkbox has ::before ... I want a different styling for 'myCheckboxLink':

console:

<table id="custom" class="display table-custom dataTable">
    <thead></thead>
    <tbody>
        <tr id="row_33" role="row" class="odd">
            <td class=" dt-checkbox" tabindex="0">
                ::before
                <a class="myCheckboxLink" tabindex="0">
                    <span class="myCheckboxSpan">
                        <i class="fa fa-check fa-check-checkbox" aria-hidden="true"></i>
                    </span>
                </a>
            </td>
        </tr>
    </tbody>
</table>

But this is not working:

css:

table.table-custom tbody td::before a.myCheckboxLink {
    display: none;
}

How can I have a different styling if td.dt-checkbox has ::before ?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.3111 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO