html - How can I color a square div with two colors? -


i have table this:

<table class="lugares">     <tr>         <td class="seat-avaliable"><div></div></td>         <td class="seat-avaliable"><div></div></td>         <td class="seat-avaliable"><div></div></td>         <td class="seat-avaliable"><div></div></td>         <td class="seat-not-avaliable"><div></div></td>         <td class="seat-badvis"><div></div></td>         <td class="seat-avaliable"><div></div></td>     </tr> </table> 

there "seat-not-available" background black, seat-available green background , want add seat (seat-badvis) 2 colors, half black , half white. tried :after , :before doesn't work.

here's fiddle code:

http://jsfiddle.net/g8p9pn1v/38/

you don't need use pseudo-selectors here, use linear-gradient instead:

background: linear-gradient(to right, #fff 50%,#000 50%); 

here's fiddle: http://jsfiddle.net/dbbtxl50/


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -