Created
June 14, 2012 15:17
-
-
Save leechy/2930927 to your computer and use it in GitHub Desktop.
Блок по центру экрана, с максимальной шириной и ограничением
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Блок по центру экрана, с максимальной шириной и ограничением | |
*/ | |
body { | |
margin: 0; | |
} | |
.b-content-with-limit { | |
max-width: 1600px; | |
margin: 0 auto; | |
} | |
.b-content-with-limit__margin { | |
padding-left: 200px; | |
} | |
.b-content-with-limit__content { | |
margin-right: -500px; | |
padding-right: 50%; | |
max-width: 100%; | |
} | |
/* вспомагательные стили */ | |
.b-layout { | |
overflow: hidden; | |
min-width: 800px; | |
} | |
.b-content { | |
max-width: 1200px; | |
height: 100px; | |
margin: 0 auto 1em; | |
background: rgb(255, 200, 200); | |
} | |
.b-limit { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 197px; | |
height: 300px; | |
border-right: 3px dashed red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="b-layout"> | |
<div class="b-content"> | |
<div style="float: left; color: black;">«</div> | |
<div style="float: right; color: black;">»</div> | |
</div> | |
<div class="b-content-with-limit"> | |
<div class="b-content-with-limit__margin"> | |
<div class="b-content-with-limit__content"> | |
<div style="height: 100px; background: rgb(0, 127, 255);"> | |
<div style="float: left; color: white;">«</div> | |
<div style="float: right; color: white;">»</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="b-limit"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment