html - Adding background-color on TD made my border disappear -


this how looked after adding background-color

enter image description here

for table , css involved :

    .styletable td,th {     padding: 10px;     text-align:left;     font-size:10pt; }   .tdcolorgrey {     background-color:#b8b8b8 ;     font-weight:bold;     border:1px; } 

and table style:

 <table class="styletable" style="width: 80%;background-color:white;" border="1"> 

the borders appear without tdcolorgrey disappear once added it.

the problem

border:1px; 

is shorthand property, literally means

border-width:1px; border-style:none; border-width:currentcolor; 

see description on mdn.
if assign class td, have border-style of none instead of inheriting table.

so possible solutions, mentioned in comments, are

  • write style explicitly in css:

    border:1px solid black; 

    (whatever style , color need, is)

  • or, remove border property css altogether, border inherit normally!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -