Reputation: 77
I can provide more specific code if necessary but this basic code should demonstrate my issue. Essentially my page looks great when the window is maximized (min-width + left + right margin). But when you minimize the window the right margin disappears.
The idea is to have a body that always maintains a specific page margin around the content. Then to have the content always centered.
Code below. I've simplified my implementation to highlight my issue.
<style>
.panel{
min-width: 1020px;
max-width: 1200px;
margin: 0px auto 15px auto;
}
</style>
<body style="margin: 10px 20px 5px 20px;">
<div class="panel">
....my content
</div>
</body>
Upvotes: 0
Views: 857
Reputation: 77
Here is the solution that I ended up using.
<style>
body{
background-color: #F5F5F5;
min-width: 1020px;
margin-top: 10px;
margin-bottom: 5px;
}
.panel{
background-color: #FFFFFF;
position: relative;
margin: 0px 20px 15px 20px
}
</style>
<body>
<div class="panel">
....my content
</div>
</body>
Thank you for all your suggestions.
Upvotes: 0
Reputation: 22663
try position fixed and forget about inline style
<style>
body{
position:fixed;
top 10px;
right:20px;
bottom:5px;
left:20px;
display:block;
}
.panel{
min-width: 1020px;
max-width: 1200px;
margin: 0px auto 15px auto;
}
</style>
<body>
<div class="panel">
....my content
</div>
</body>
Upvotes: 0
Reputation: 2247
You need to use 'display:inline-block;'
<body style="display:inline-block;margin: 10px 20px 5px 20px;">
<div class="panel">
....my content
</div>
</body>
Upvotes: 0