I'd like to make a webpage like this:
|----------------------------| | header | |----------------------------| | L | | | e | | | f | | | t | | | | | | S | Content Area | | i | | | d | | | e | | | b | | | a | | | r | | |----------------------------|
The header has a fixed height but it's width should be dynamic. The left-sidebar should have a fixed width but a dynamic height. For the content area, both height and width are dynamic. When user scale their browser, the scrolling bar should not appear(not set overflow:hidden; to hide it.).
I tried to write code like this:
<div class="top"> TOP </div> <div class="left"> LEFT </div> <div class="main"> MAIN </div>
with CSS:
.top { width: 100%; height: 92px; } .left { width: 178px; height: 100%; float:left; } .main { float: left; height: 100%; width: 100%; }
But it failed.
EDIT: Content Area and Left-SideBar must fill the whole browser window..... I don't need
|----------------------------| | header | |----------------------------| | L | | | e | | | f | | | t | | | | | | S | Content Area | | i | | | d |----------------------| | e | | b | | a | | r | |-----|
The header has a fixed height but it's width should be dynamic. The left-sidebar should have a fixed width but a dynamic height. For the content area, both height and width are dynamic. When user scale their browser, the scrolling bar should not appear(not set overflow:hidden; to hide it.).
To set the heading alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <h1> to <h6> tag, with the CSS property text-align. HTML5 do not support the align attribute of the heading tag, so the CSS style is used to set alignment.
The easiest way to handle this is just to use CSS fixed positioning. Our sidebar is within a #page-wrap div with relative positioning, so the sidebar will set inside there, then we just push it over into place with margin. With this technique, the sidebar stays solidly in place as you scroll down the page.
The <header> tag in HTML is used to define the header for a document or a section as it contains the information related to the title and heading of the related content. The <header> element is intended to usually contain the section's heading (an h1-h6 element or an <hgroup> element), but this is not required.
example at jsFiddle
.top { position:absolute; left:0; right:0; height: 92px; } .left { position:absolute; left:0; top:92px; bottom: 0; width: 178px; } .main { position: absolute; left:178px; top:92px; right:0; bottom:0; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With