Live data from Hacker News

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

raw.gibney.org

31–35 of 35 posts

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

#31
post #28

Sure there is, here is my saturday morning no coffee's take on it: * { -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%; f…

Its not the same. You made a lot of changes. For example deleting the textarea and other elements.

Just put the textarea in the left panel.

He asked for the layout in HTML5, not the same code. Separating content from presentation is a better practice than shoveling it all in a table.

   
   
           
               * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
       
               html, body, form { 
                   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%;
               }

               textarea { width: 100%; height: 100% }
   
           
   
           
               
                   Hey I'm a header
                   
                       
                           Write here
                       
                       Right Panel
                   
                   
                       I'm a footer, hit submit

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

#32
post #30
post #27

Earlier quoted context omitted.

The best solution so far! http://raw.gibney.org/height_test_standards_1 Only problem: The textare is slighty misaligned.

you just need to add this to textarea -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;

Awesome! We got it!

http://raw.gibney.org/height_test_standards_2

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

#33
post #28

Earlier quoted context omitted.

Its not the same. You made a lot of changes. For example deleting the textarea and other elements.

Just put the textarea in the left panel. He asked for the layout in HTML5, not the same code. Separating content from presentation is a better practice than shoveling it all in a table. * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } html, body, form { height: 100%; width: 100%; border: 0px; margin: 0px; padding: 0px; } .header,.footer { width: 100%; height: 10%; /*use perce…

Same problem as with "thegooley"s solution.

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

#34
post #33

Earlier quoted context omitted.

Just put the textarea in the left panel. He asked for the layout in HTML5, not the same code. Separating content from presentation is a better practice than shoveling it all in a table. * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } html, body, form { height: 100%; width: 100%; border: 0px; margin: 0px; padding: 0px; } .header,.footer { width: 100%; height: 10%; /*use perce…

Same problem as with "thegooley"s solution.

change height: 10% to min-height: 10% in “.header, .footer” ?

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

#35
post #33

Earlier quoted context omitted.

Same problem as with "thegooley"s solution.

change height: 10% to min-height: 10% in “.header, .footer” ?

Not the same. In the original, the footer adopts its height to its content. Putting in a min-height of 10% will not accomplish that. You can simply verify it by comparing your solution and the original visually. They look completely different.

Please be aware, that meanwhile there is a working solution here:

http://raw.gibney.org/height_test_standards_2

It was suggested by jlft but his post got no upvotes, so its burried almost on the bottom of this thread.

Post reply on HN