WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child theme CSS question (3 posts)

  1. linguine999
    Member
    Posted 3 years ago #

    Hi,
    I have created a child theme for the blue-grey-white theme and want to stop the child inheriting one of the table attributes?

    The parent theme css has the following:

    table, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    }

    I want to have different table background colors for different tables in my html so don't want to set it at all in the CSS as I want to set them in the html of individual pages.

    Is there a way to just clear the background attribute?

    Thanks

  2. Digital Raindrops
    Member
    Posted 3 years ago #

    If you view the page source you will likeky find that the table has a class or is inside a div that you can reference, then you can just add styles, inline styles are not as efficient, so keep them to a minimum.

    Style.css

    .entry-content table {
    	background: #f1f1f1;
    }
    
    .comment-content table {
    	background: #e0e0e0;
    }
    .post-133 .entry-content table {
    	background: #f1f1f1;
    }

    Inline style HTML

    <table style="background:#e0e0e0;">

    HTH

    David

  3. linguine999
    Member
    Posted 3 years ago #

    Thanks David, problem solved!
    Cheers
    Lin

Topic Closed

This topic has been closed to new replies.

About this Topic