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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Internet Explorer border-top, border-bottom in IE won't work

    Hej!

    I've got a little problem with some border styling. I want a border-bottom and a border-top on a table row. In IE 6, IE 7 and IE 8 there is no border. It works in all other browsers.

    Here is my css:
    Code:
    .switchcontentZi {
    	border-top: 1px solid black !important;
            border-bottom: 1px solid black !important;
    }
    And here is my HTML-Construct:
    Code:
    <table class="medium" width="720">
         <tr id="room1" class="switchcontentZi" style="display: block;">
         <tr id="room2" class="switchcontentZi" style="display: block;">
         <tr id="room3" class="switchcontentZi" style="display: block;">
         <tr id="room4" class="switchcontentZi" style="display: block;">
         <tr id="room5" class="switchcontentZi" style="display: block;">
    </table>
    I've already searched in this forum and via google and found some hints that the "display: block" could be the problem. But I couldn't solve this problem.

    Can someone help me and fix this problem?

    Blackeye
    Last edited by Blackeye; 09-14-2011 at 07:24 AM. Reason: Resolved

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    It generally works best to put the border onto the td and/or th elements in the row. You can achieve that with your existing CSS with only a minor tweak:

    Code:
    .switchcontentZi td, .switchcontentZi th{
    	border-top: 1px solid black !important;
    	border-bottom: 1px solid black !important;
    }
    With that said, you aren't showing us any td or th elements in those rows... they are there, aren't they?
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    Blackeye (09-14-2011)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,634
    Thanks
    6
    Thanked 1,002 Times in 975 Posts
    Yeah, don’t style table rows, style the cells in these rows. Table rows have proven inconsistent in different browsers when it comes to CSS.

  • #4
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You are my heroes! Thank you very much for this hint!

    Now it works perfect in all browsers!


  •  

    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
    •