Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Html example with a top with specific height and the rest of the content with width 100%
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type="text/css">
html,
body{
padding: 0px;
margin: 0px;
height: 100%;
width: 100%;
}
#root {
height:100%;
width:100%;
background:blue;
position:relative;
}
#top {
height:30px;
position:absolute;
background:green;
width:100%;
}
#main {
position:absolute;
width:100%;
top:30px;
bottom:0;
background:red;
}
</style>
</head>
<body>
<div id="root">
<div id="top"></div>
<div id="main"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment