Mijn vraag
Ik ben bezig met een responsive website die opzich prima werkt alleen het gedeelte als de website minder dan 600px breed word werkt niet goed. Het is de bedoeling dat de navigatie dan de volledige breedte van het scherm benut maar er blijft wat ik ook doe een witte ruimte links naast de navigatie.
Relevante software en hardware die ik gebruik
Brackets / Chrome
Wat ik al gevonden of geprobeerd heb
Heb al veel gegoogled of sommige mensen hetzelfde probleem hebben maar kan zo niet het juiste andwoord vinden. Heb hieronder de relevante code genoteerd.
HTML
<!DOCTYPE html>
<html lang="nl">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/topStyle.css">
<link rel="stylesheet" type="text/css" href="css/mainStyle.css">
<link rel="stylesheet" type="text/css" href="css/bottomStyle.css">
</head>
<body>
<div class="topBar">
</div>
<div class="logoBar">
</div>
<div class="navigation">
<ul>
<li><a href="index.html">Home</a></li><li>
<a href="index.html">Link 1</a></li><li>
<a href="index.html">Link 2</a></li><li>
<a href="index.html">Contact</a></li>
</ul>
</div>
<div class="main">
</div>
<div class="footer">
<div class="footerContent">
</div>
</div>
</body>
</html>
CSS
.topBar {
background-color: gray;
width: 100%;
height: 30px;
}
logoBar {
width: 70%;
background-color: #fff;
height: 50px;
margin: auto;
}
.navigation {
width: 70%;
margin: auto;
}
.navigation ul {
position: relative;
list-style: none;
}
.navigation ul li {
display: inline-block;
}
.navigation ul li a:link, .navigation ul li a:visited {
font-family: helvetica;
font-size: 16px;
font-weight: bold;
text-decoration: none;
color: #000;
padding: 5px;
}
.navigation ul li a:active, .navigation ul li a:hover {
background-color: gray;
color: #fff;
border-radius: 5px;
}
@media (max-width:600px) {
logoBar {
width: 100%;
}
.navigation {
width: 100%;
}
.navigation ul li {
display: block;
text-align: center;
background-color: gray;
}
}
Ik ben bezig met een responsive website die opzich prima werkt alleen het gedeelte als de website minder dan 600px breed word werkt niet goed. Het is de bedoeling dat de navigatie dan de volledige breedte van het scherm benut maar er blijft wat ik ook doe een witte ruimte links naast de navigatie.
Relevante software en hardware die ik gebruik
Brackets / Chrome
Wat ik al gevonden of geprobeerd heb
Heb al veel gegoogled of sommige mensen hetzelfde probleem hebben maar kan zo niet het juiste andwoord vinden. Heb hieronder de relevante code genoteerd.
HTML
<!DOCTYPE html>
<html lang="nl">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/topStyle.css">
<link rel="stylesheet" type="text/css" href="css/mainStyle.css">
<link rel="stylesheet" type="text/css" href="css/bottomStyle.css">
</head>
<body>
<div class="topBar">
</div>
<div class="logoBar">
</div>
<div class="navigation">
<ul>
<li><a href="index.html">Home</a></li><li>
<a href="index.html">Link 1</a></li><li>
<a href="index.html">Link 2</a></li><li>
<a href="index.html">Contact</a></li>
</ul>
</div>
<div class="main">
</div>
<div class="footer">
<div class="footerContent">
</div>
</div>
</body>
</html>
CSS
.topBar {
background-color: gray;
width: 100%;
height: 30px;
}
logoBar {
width: 70%;
background-color: #fff;
height: 50px;
margin: auto;
}
.navigation {
width: 70%;
margin: auto;
}
.navigation ul {
position: relative;
list-style: none;
}
.navigation ul li {
display: inline-block;
}
.navigation ul li a:link, .navigation ul li a:visited {
font-family: helvetica;
font-size: 16px;
font-weight: bold;
text-decoration: none;
color: #000;
padding: 5px;
}
.navigation ul li a:active, .navigation ul li a:hover {
background-color: gray;
color: #fff;
border-radius: 5px;
}
@media (max-width:600px) {
logoBar {
width: 100%;
}
.navigation {
width: 100%;
}
.navigation ul li {
display: block;
text-align: center;
background-color: gray;
}
}