Created
April 19, 2014 13:28
-
-
Save fengyie007/11084439 to your computer and use it in GitHub Desktop.
Untitled
This file contains hidden or 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
<p style="border:1px solid red; width:200px; padding:20px;"> | |
T | |
<span style="background-color:#C0C0C0; position:relative;"> | |
这段文字从左向右排列,红 XX 和 蓝 XX 和黄 XX 都是绝对定位元素,它的包含块是相对定位的SPAN。 可以通过它们绝对定位的位置来判断它们包含块的边缘。 | |
<em style="position:absolute; color:red; top:0; left:0;">XX</em> | |
<em style="position:absolute; color:yellow; top:20px; left:0;">XX</em> | |
<em style="position:absolute; color:blue; bottom:0; right:0;">XX</em> | |
</span> | |
</p> | |
<p style="border:1px solid red; width:200px; padding:20px;"> | |
TEXT TEXT TEXT | |
<span style="background-color:#C0C0C0; position:relative;"> | |
这段文字从左向右排列,红 XX 和 蓝 XX 和黄 XX 都是绝对定位元素,它的包含块是相对定位的SPAN。 可以通过它们绝对定位的位置来判断它们包含块的边缘。 | |
<em style="position:absolute; color:red; top:0; left:0;">XX</em> | |
<em style="position:absolute; color:yellow; top:20px; left:0;">XX</em> | |
<em style="position:absolute; color:blue; bottom:0; right:0;">XX</em> | |
</span> | |
</p> | |
<p style="border:1px solid red; width:200px; padding:20px; direction:rtl;"> | |
T | |
<span style="background-color:#C0C0C0; position:relative;"> | |
这段文字从右向左排列,红 XX 和 蓝 XX 和黄 XX 都是绝对定位元素,它的包含块是相对定位的SPAN。可以通过它们绝对定位的位置来判断它们…… | |
<em style="position:absolute; color:red; top:0; left:0;">XX</em> | |
<em style="position:absolute; color:yellow; top:20px; left:0;">XX</em> | |
<em style="position:absolute; color:blue; bottom:0; right:0;">XX</em> | |
</span> | |
</p> | |
<div id="container" style="padding:50px; background-color:#c0c0c0; position:relative; width:200px; height:200px;"> | |
<div id="div1" style="width:100%; height:100%; border:2px solid blue;"> | |
<div id="content" style="border:1px solid red; position:absolute; left:0; top:0;">absolute element</div> | |
</div> | |
</div> |
This file contains hidden or 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
// alert('Hello world!'); |
This file contains hidden or 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-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment