Frankwin
Gebruiker
- Lid geworden
- 1 jan 2001
- Berichten
- 905
Ik ben bezig met een website bestaande uit 4 divs: header, linker menu, content en rechter menu.
De menu's hebben een vaste breedte (respectievelijk 205 en 120 pixels) en nu wil ik dat mijn content de rest van de schermbreedte gebruikt.
(in een frameset kon dat met cols="205, * ,120").
Is dit mogelijk met CSS?
Mijn code:
De menu's hebben een vaste breedte (respectievelijk 205 en 120 pixels) en nu wil ik dat mijn content de rest van de schermbreedte gebruikt.
(in een frameset kon dat met cols="205, * ,120").
Is dit mogelijk met CSS?
Mijn code:
Code:
<!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>3 kolommen layout</title>
<style type="text/css">
body
{
background-color: #CCCCFF;
font-family: Times New Roman, Times, serif;
color: #000066;
font-weight: normal;
margin: 0;
padding: 0;
text-align: center;
}
#container
{
position: static;
width: 100%;
text-align: left;
margin-left: auto;
margin-right: auto;
}
#header
{
width: 100%;
height: 150px;
position: static;
background-color: yellow;
color: #0000FF;
top: 0;
margin-left: auto;
margin-right: auto;
margin-top: 5px;
}
#links
{
background-color: blue;
width: 205px;
height: 600px;
position: relative;
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
float: left;
}
#content
{
background-color: green;
width: 500px; /*hoe maak je deze breedte relatief ? */
height: 600px;
position: relative;
margin-top: 5px;
margin-right: auto;
float: left;
}
#rechts
{
width: 120px;
height: 600px;
position: relative;
background-color: red;
float: right;
margin-top: 5px;
margin-right: 5px;
right: 0;
}
</style>
</head>
<body>
<div id="container">
<div id="header">HEADER</div>
<div id="links">LINKS</div>
<div id="content">INHOUD</div>
<div id="rechts">RECHTS</div>
</div>
</body>
</html>