Current location: Hot Scripts Forums » General Web Coding » CSS » Div height


Div height

Reply
  #1 (permalink)  
Old 06-08-07, 12:13 PM
qie's Avatar
qie qie is offline
Newbie Coder
 
Join Date: May 2005
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Div height

Hi all....,

i have test for height of Div tag to 100%, when i used:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
IT CAN'T

but when i just used:
HTML Code:
<html>
IT CAN RUN, DIV TO 100%

how to cheat it?
__________________
Klori
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-08-07, 12:34 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
can you post the code you used for the <div> element?
this should work:
HTML Code:
<div style="height:100%">content here</div>
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-08-07, 12:41 PM
qie's Avatar
qie qie is offline
Newbie Coder
 
Join Date: May 2005
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
yes yes... i know that but i found the answer, the key is position:absolute

thanks

Quote:
Originally Posted by UnrealEd View Post
can you post the code you used for the <div> element?
this should work:
HTML Code:
<div style="height:100%">content here</div>
__________________
Klori
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-18-07, 08:10 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, I think it didn't work in the original code because the doctype forced the browser into standard compliance mode. Then divs won't ever extent beyond their content unless you give them absolute dimensions, like you did.
But if you don't use the doctype, you get what's become known as "quirksmode", which is whatever the browser-makers prefer to do when there were no standards around or they simply disobeyed them
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
div 100% height in IE hinch CSS 2 10-24-06 09:07 AM
Can't Understand java script maverickminds JavaScript 1 07-16-06 02:23 PM
expanding a div to keep image contained pukington HTML/XHTML/XML 0 12-26-05 09:04 AM
semi-dynamic div height changes koncept JavaScript 2 05-03-05 11:20 AM
Scrollbar!!!!!! LiLSweetie HTML/XHTML/XML 8 07-22-04 06:01 PM


All times are GMT -5. The time now is 08:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.