I have this simple page layout:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<style>
body {
text-align: center;
margin: 0;
padding: 0;
}
.header {
width: 100%;
height: 50px;
background: url('http://tinyurl.com/o8w87av') 50% 0 no-repeat;
}
.outer {
width:960px;
height: 300px;
background: #dadada;
margin: 0 auto;
}
.footer {
width: 100%;
height: 50px;
background: #000;
}
</style>
</head>
<body>
<div class="header"></div>
<div class="outer"></div>
<div class="footer"></div>
</body>
</html>
On desktop it works fine but on mobile or tablet no. I think that there is some problem with width: 100%; but I can't figure it out how to resolve it.
Some interesting things I find out:
Thank you very much for helping me!
SOLVED: Thanks to Maximilian Hoffmann advice I was able to figure it out. I just add min-width: 960px to header and footer and now it's working correctly.
Thanks to Maximilian Hoffmann advice I was able to figure it out. I just add min-width: 960px to header and footer and now it's working correctly.