• Resolved elipsett

    (@elipsett)


    I want to put a light background color in a table.
    I suspect the same problem, whatever it is, is also preventing me from adding color to text.

    There was no background color shown when I coded it manually, so I put the table in Dreamweaver to see what the problem was, and it displays perfectly in DW. Here is the pertinent code:

    <table width="90%" border="1" cellpadding="2">
      <caption>
        Caption for the table
      </caption>
      <tbody>
        <tr>
          <th align="center" valign="middle" bgcolor="#F4BFC0" scope="col">Upper left</th>
          <th align="center" valign="middle" bgcolor="#F4BFC0" scope="col">Upper right</th>
        </tr>
        <tr>
          <td align="center" valign="middle" bgcolor="#F4BFC0">Lower left</td>
          <td align="center" valign="middle" bgcolor="#F4BFC0">Lower right</td>
        </tr>
      </tbody>
    </table>
Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter elipsett

    (@elipsett)

    Our messages are posting here out of order.

    I just published your code, and as you can see the first one (bg specification in individual cells with !important) worked. For the first time!

    So the suggestion here is that the DW code (bgcolor) is not being parsed correctly by the WP engine, and using your code is.

    Thank you! I should be able to work it out from here.

    Are you up for looking at the child theme issue, too?

    Clarion Technologies

    (@clarionwpdeveloper)

    Regarding child theme issue
    https://ww.wp.xz.cn/support/topic/mantra-setting-class-text-colorsize-in-child-theme?replies=1

    I will suggest you to add “!important” property to last two line of code.
    Please use Below code:

    div.PRtext {
    	margin-left:2em;
    	margin-right: 2.5em;
    	font-style: italic;
    	color: #008000 !important;
    	font-size:12px !important;
    	}
    Thread Starter elipsett

    (@elipsett)

    Nope.
    If you look at this URL, you’ll see the result is indented and italic, but no color or point size change. (should be pink and BIG)
    First paragraph

    Changing the text size increases the indent (because it is measured in em), so obviously something is happening, but the actual text is not changed.

    Thread Starter elipsett

    (@elipsett)

    I just tried this, and the background color changed:

    div.PRtext {
    	margin-left:2em;
    	margin-right: 2.5em;
    	font-style: italic;
    	background-color: #F4BFC0 !important;
    	color: #F4BFC0 !important;
    	font-size:24px !important;
    	}
    Clarion Technologies

    (@clarionwpdeveloper)

    Please rename class name to “.PRtext p” so it will be like:

    .PRtext p {
    	margin-left:2em;
    	margin-right: 2.5em;
    	font-style: italic;
    	color: #008000 !important;
    	font-size:12px !important;
    }

    Then Adjust font size according to your need.

    Thread Starter elipsett

    (@elipsett)

    Does the code on that paragraph change?
    Does it become
    <p class="PRtext">blah blah</p>

    At the moment it is marked off by DIV tags.

    Thread Starter elipsett

    (@elipsett)

    Just to verify, the functions.php file inside the same mantra-child directory reads:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
    Clarion Technologies

    (@clarionwpdeveloper)

    You don’t need to do any changes in html,
    just need to replace below css code

    from:
    div.PRtext {
    	margin-left:2em;
    	margin-right: 2.5em;
    	font-style: italic;
    	background-color: #F4BFC0 !important;
    	color: #F4BFC0 !important;
    	font-size:24px !important;
    	}
    
    to
    
    .PRtext p {
    	margin-left:2em;
    	margin-right: 2.5em;
    	font-style: italic;
    	color: #008000 !important;
    	font-size:12px !important;
    }

    Thread Starter elipsett

    (@elipsett)

    None of the specs function (no indent or italics) for either.In other words, the new code is totally dysfunctional.
    <div class="PRtext"><p>blah blah </p></div>
    or
    <div> <p class="PRtext">blah blah </p></div>
    or
    <p class="PRtext">blah blah </p>

    Clarion Technologies

    (@clarionwpdeveloper)

    I know I didn’t ask you to do so ,
    you just have to replace
    div.PRtext to .PRtext p

    just doing this will solve your problem.

    Thread Starter elipsett

    (@elipsett)

    Oops again. My error.

    It seems to be functioning perfectly.

    I didn’t have the old code properly disabled.

    And I guess that resolves both my problems!

    Thank you very much for taking the time to help me out on this.

    Clarion Technologies

    (@clarionwpdeveloper)

    You are most welcome
    Please close this ticket.

    Thread Starter elipsett

    (@elipsett)

    Just closed both!
    🙂

Viewing 13 replies - 16 through 28 (of 28 total)

The topic ‘Table background color missing’ is closed to new replies.