+ 1

What is the error in this----> color of text and border is not changing

css---> td.top { vertical-align: top; } td.middle { vertical-align: middle; } td.bottom { vertical-align: bottom; } div.table{ color:red; border-width:10px; border-color:purple; bgcolor:yellow; } html---> <html> <body> <table border="1" cellpadding="2" cellspacing="0" style="height: 150px;"> <div class="table"> <tr> <td class="top">Top</td> <td class="middle">Middle</td> <td class="bottom">Bottom</td> </tr> </div> </table> </body> </html>

26th Dec 2017, 6:55 PM
Kratos
Kratos - avatar
10 odpowiedzi
+ 8
https://code.sololearn.com/Codes/ Paste your code in code playground and then post it here.
26th Dec 2017, 7:19 PM
Ranjan Bagri
Ranjan Bagri - avatar
26th Dec 2017, 8:24 PM
Scooby
Scooby - avatar
+ 2
@ranjan didn't get u!
26th Dec 2017, 7:15 PM
Kratos
Kratos - avatar
+ 1
your not supposed to write td just do bottom{ not td.bottom{
26th Dec 2017, 6:58 PM
Daniel Prince
Daniel Prince - avatar
+ 1
this is not a error... color of table is not changing why?..
26th Dec 2017, 7:02 PM
Kratos
Kratos - avatar
+ 1
Made mods to table in html and css selections. https://code.sololearn.com/WRS2HxMCt6y3/?ref=app
26th Dec 2017, 7:20 PM
John Wells
John Wells - avatar
+ 1
You had div as child of table so it couldn't change it. I moved it as parent fixing text color, but not border. Adding the class to table fixed the border.
26th Dec 2017, 7:31 PM
John Wells
John Wells - avatar
+ 1
ohhh ohk ohk now i get it ... i just misplaced the things thakx
26th Dec 2017, 7:33 PM
Kratos
Kratos - avatar
26th Dec 2017, 7:25 PM
Kratos
Kratos - avatar
0
@john wells but why it not working when we apply class in div <table> is child elemnt of it so this must be directly apply to table also.???
26th Dec 2017, 7:27 PM
Kratos
Kratos - avatar