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 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile CSS "table" display - semantics help

    Hello everybody,
    here's the situation:

    I have a <DIV>.
    In concern to the layout I wish it to have a minimum of 400px left border.
    However, I wish it to retain its content-sensitive auto-expand ability.

    That I achieve here:
    Code:
    float: left;
    display: table;
    width: 500px;
    height: 400px;
    border-left: 1px solid #ececec;
    As far as I know, the "table" display of a page layout DIV interferes with the semantics rules. Thus, it would be similar to making the layout with a <table> tag.

    So, is there a workaround for the same functionality?

    Thank you very much!

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    Do you mean a minimum height of 400px?

    if so:

    Code:
    div {
    float: left;
    width: 500px;
    min-height: 400px;
    border-left: 1px solid #ececec;
    }
    then for IE lte 6
    Code:
    <!--[if lte IE 6]>
    <style type="text/css" media="screen">
    div {
    height: 400px;
    }
    </style>
    <![endif]-->
    Older IEs consider height the same as minimum height.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by Shadowfox View Post
    As far as I know, the "table" display of a page layout DIV interferes with the semantics rules. Thus, it would be similar to making the layout with a <table> tag.
    No, the only thing that affects the semantics of a document is the HTML, not the CSS. So, making a <div> have display:table or a <table> have display:block won't affect the HTML at all.

    That's one reason why display:table is available in the first place—to give elements the visual behavior of a table while allowing the proper element to be used for good semantics.

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Except IE doesn't utilise it. Great...

  • #5
    New Coder
    Join Date
    Feb 2006
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Thank you very much!


  •  

    Posting Permissions

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