Skip to content

Instantly share code, notes, and snippets.

@robhrt7
Created April 16, 2012 22:13
Show Gist options
  • Save robhrt7/2402023 to your computer and use it in GitHub Desktop.
Save robhrt7/2402023 to your computer and use it in GitHub Desktop.
Пример абс и static для tohtml.it
.wrapper {
width: 100px;
margin-bottom: 10px;
position: relative;
}
.static {
/* position: static - блоки по умолчанию статичны */
overflow: hidden;
width: 77px;
height: 77px;
margin: 20px;
padding: 5px;
background: red;
}
.absolute {
position: absolute;
right: -20px;
top: 20px;
width: 40px;
height: 40px;
background: green;
color: #fff;
}
.relative {
position: relative;
}
.fixed {
position: fixed;
left: 115px;
top: 0;
}
<div class="wrapper">
<div class="static overflow-hidden">
1 static
<div class="absolute">abs</div>
</div>
</div>
<div class="wrapper">
<div class="static relative">
2 relative
<div class="absolute">abs</div>
</div>
</div>
<div class="wrapper">
<div class="static fixed">
3 fixed
<div class="absolute">abs</div>
</div>
</div>
{"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