Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    189
    Thanks
    38
    Thanked 3 Times in 3 Posts

    right border causes bottom border to disappear

    Hey all,

    As soon as I added this line of code:
    colgroup col:first-child {
    border-right: 1px solid red;
    }


    The bottom border disappeared. Anyone know why?
    Code:
    <style>
    	table {
    		color: #fff;
    		background-color: #202120;
    		border-collapse: collapse;
    	}
    
    	colgroup col:first-child {
    		border-right: 1px solid red;
    	}
    	
    	tbody:first-child {
    		border-bottom: 1px solid red;
    	}
    	
    	td[colspan] {
    		text-align: center;
    	}
    </style>
    
    <table>
    	<colgroup span="2">
    		<col span="1">
    		<col span="1">
    	</colgroup>
    	<tbody>
    		<tr>
    			<td>Email a support question.</td>
    			<td>Chat with a Support Personnel</td>
    		</tr>
    		<tr>
    			<td>Call Me Now</td>
    			<td>User Manual</td>
    		</tr>
    	</tbody>	
    	<tbody>
    		<tr>
    			<td colspan="2">FAQ</td>
    			<td>&nbsp;</td>
    		</tr>	
    	</tbody>		
    </table>
    thanks for response

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    There is no bottom border, with or without that CSS selector (IE and FF tested). What are you talking about? On which browser?

    Maybe you don't understand too well what :first-child pseudo class means. The :first-child pseudo class means "if this element is the first child of its parent", not the first child of this element.
    Last edited by Kor; 06-24-2010 at 02:33 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •