Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2008, 05:54 AM   PM User | #1
Shadowfox
New Coder

 
Join Date: Feb 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Shadowfox is an unknown quantity at this point
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!
Shadowfox is offline   Reply With Quote
Old 02-25-2008, 12:53 PM   PM User | #2
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,769
Thanks: 8
Thanked 127 Times in 125 Posts
harbingerOTV will become famous soon enough
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
harbingerOTV is offline   Reply With Quote
Old 02-25-2008, 04:50 PM   PM User | #3
rmedek
Senior Coder

 
Join Date: Nov 2003
Location: Minneapolis, MN
Posts: 2,879
Thanks: 2
Thanked 65 Times in 56 Posts
rmedek is on a distinguished road
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.
__________________
drums | web
rmedek is offline   Reply With Quote
Old 02-25-2008, 04:52 PM   PM User | #4
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
Except IE doesn't utilise it. Great...
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Old 02-25-2008, 05:16 PM   PM User | #5
Shadowfox
New Coder

 
Join Date: Feb 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Shadowfox is an unknown quantity at this point
Smile

Thank you very much!
Shadowfox is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:25 PM.


Advertisement
Log in to turn off these ads.