I am relatively new to CSS. I am trying to create a normal page layout using HTML & CSS, but I am facing an issue. Here is my HTML.
<!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">
<head>
<title>Jquery</title>
<link rel="stylesheet" type="text/css" href="../css/StyleSheet1.css">
<script type="text/javascript" src="../javascript/jQuery.js""></script>
</head>
<body>
<div class="container">
<div class="header"></div>
<div class="content"></div>
<div class="footer"></div>
</div>
</body>
</html>
Here is my CSS script
html,body
{
padding: 0px;
margin: 0px;
color: #555;
font-size: 20px;
font-family: "Open Sans","lucida grande","Segoe UI",arial,verdana,"lucida sans unicode",tahoma,sans-serif;
height: 100%;
}
.container
{
height: 100%;
background-color: Green;
position: relative;
}
.header
{
height: 300px;
width: 100%;
background-color: Red;
}
.content
{
width: 100%;
background-color: Black;
}
.footer
{
height: 500px;
width: 100%;
background-color: Violet;
position: absolute;
bottom: 0px;
}
I am trying to create a header, footer and a content div. But my content div should automatically change it's height. If there is nothing inside content div then my page should at least have content height equal to (page height - (header height + footer height)).