TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is there a way to do this layout in HTML 5?

26 pointsby gealmost 13 years ago
Meanwhile jlft has posted the right answer to this. Scroll way down to see it. Its on the second last position of this thread.

12 comments

tambourine_manalmost 13 years ago
Sure there is, here is my saturday morning no coffee's take on it:<p><pre><code> &#60;!doctype html&#62; &#60;style type="text/css"&#62; * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } html, body { height: 100%; width: 100%; border: 0px; margin: 0px; padding: 0px; } .header,.footer { width: 100%; height: 10%; /*use percentage or fixed size*/ border: 1px solid red; } .content { width: 100%; height: 80%; } .leftPanel, .rightPanel { width: 50%; float: left; border: 1px solid red; height: 100%; } &#60;/style&#62; &#60;body&#62; &#60;div class="header"&#62;Hey I'm a header&#60;/div&#62; &#60;div class="content"&#62; &#60;div class="leftPanel"&#62;Left Panel Here&#60;/div&#62; &#60;div class="rightPanel"&#62;Right Panel&#60;/div&#62; &#60;/div&#62; &#60;div class="footer"&#62;I'm a footer&#60;/div&#62; &#60;/body&#62; </code></pre> <i>You should probably ask this question on StackOverflow.com</i><p>And it's probably been answered there already.But what heck.
评论 #4305592 未加载
JOfferijnsalmost 13 years ago
You should probably ask this question on StackOverflow.com
评论 #4305553 未加载
the1almost 13 years ago
<a href="http://pastehtml.com/view/c6bge5hig.html" rel="nofollow">http://pastehtml.com/view/c6bge5hig.html</a><p>table { position:absolute; top: 0; bottom: 0; ....
评论 #4305545 未加载
fallenhitokirialmost 13 years ago
You need 6 div. one container. Everything goes in there. One header, one wrapper that holds the two big boxes and a footer.<p>Set HTML &#38; body height to 100%. If you don't your container and other divs will likely ignore your height:100%<p>Everything else you need from there is float, position, clear, width and height. Should even be compatible with most versions of IE.<p>Sp yes it is possible and even simple with HTML and CSS. No need for tables.
评论 #4305569 未加载
jlftalmost 13 years ago
Add this:<p>form { height: 100%; } td {height: 100%; }
评论 #4305585 未加载
Olreichalmost 13 years ago
The form is the element screwing you over. It's compressing everything to minimum. Set form{height:100%} and it spans the page again. You can also move the form just inside of the table and get the desired effect.
评论 #4305599 未加载
Fyrilinalmost 13 years ago
You may find this useful: <a href="http://matthewjamestaylor.com/blog/equal-height-columns-2-column.htm" rel="nofollow">http://matthewjamestaylor.com/blog/equal-height-columns-2-co...</a>
EvaPeronalmost 13 years ago
It has been a while since I have played around with HTML (do Java at work, mostly) but surely one can do tables in HTML 5, as in previous versions? If not, something wrong there, IMO...
thegooleyalmost 13 years ago
Is this the kind of code that you're looking for? <a href="http://files.thegooley.com/example-fullpage-app.html" rel="nofollow">http://files.thegooley.com/example-fullpage-app.html</a>
评论 #4305564 未加载
benmannsalmost 13 years ago
Here's a jsFiddle in HTML5 mode with the table code pre-entered if anyone wants to play with it: <a href="http://jsfiddle.net/bzf9W/" rel="nofollow">http://jsfiddle.net/bzf9W/</a>
dousalmost 13 years ago
<a href="https://gist.github.com/3193548" rel="nofollow">https://gist.github.com/3193548</a>
评论 #4305549 未加载
mericalmost 13 years ago
Do you have to use &#60;table&#62;?
评论 #4305528 未加载
评论 #4305567 未加载
评论 #4305529 未加载