Overriding background: transparent to allow table attribute bgcolor to do its thing

Discussion in 'CSS' started by sarahk, Jun 20, 2012.

  1. #1
    I'm creating a child theme of wordpress' twentyten theme and adding overlib into it.

    The coding of overlib could do with a few id tags to allow me to style more precisely but I can live with that if I can disable this for tables

    [COLOR=#000000][FONT=Consolas]html[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]body[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]div[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]span[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]applet[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]object[/FONT][/COLOR][COLOR=#000000][FONT=Consolas], [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]iframe[/FONT][/COLOR][COLOR=#000000][FONT=Consolas],[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]h1, h2, h3, h4, h5, h6, p, blockquote, pre,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]a, abbr, acronym, address, big, cite, code,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]del, dfn, em, font, img, ins, kbd, q, s, samp,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]small, strike, strong, sub, sup, tt, var,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]b, u, i, center,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]dl, dt, dd, ol, ul, li,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]fieldset, form, label, legend,[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]table, caption, tbody, tfoot, thead, tr, th, td {[/FONT][/COLOR]
    [COLOR=#000000][FONT=Consolas]    background: transparent;
        border: 0;
        margin: 0;
        padding: 0;
        vertical-align: baseline;}[/FONT][/COLOR]
    Code (markup):


    The idea with the child theme is that you have your own stylesheet that overrides this with what I really want.

    Thing is, if I then create
    table {background: white}
    Code (markup):
    the backgrounds are white.


    What I really want is for the browser to use the basic table attribute: bgcolor
    <table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#0000CC">
    Code (markup):

    Or do I just have to start hacking overLib to give it ids the way it should?
     
    sarahk, Jun 20, 2012 IP
  2. IDocXD

    IDocXD Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    I know this is a late reply. But have you tried:

    
    table {background: transparent}
    or
    table {background: none}
    
    Code (markup):
     
    IDocXD, Jul 2, 2012 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    background:inherit; may work, but not sure about all browsers.

    Though NONE of us has ANY business using the bgcolor attribute after 2001... Is there some reason you want to use 1997 style markup? border? Cellpadding? bgcolor? Are you using other HTML 3.2 rubbish like CENTER and FONT too.

    I also have no clue what "overlib" is, but that garbage reset that's nulling values that could be screwing up your layout (much akin to Eric Meyer's idiotic "reset reloaded") .. messing with the backgrounds? Border? (if you're gonna reset border it should be done on img and fieldset, and that's IT). The broken vertical-align (if you care about IE7/lower?)

    Admittedly, you said you're working with Wordpress... so you're automatically saddled with rubbish markup, but that's no reason to throw decade out of date methodologies at it.
     
    deathshadow, Jul 2, 2012 IP
    sarahk likes this.