CSS 层定位

请为预置代码设置如下内容的样式:

第一个段落:固定定位,距离顶部30px,距离左方30px
第二个段落:固定定位,距离底部30px,距离右方30px
第三个段落:相对定位,相对于正常位置向下30px,向右30px
第四个段落:相对定位,相对于正常位置向下30px,向左30px
第五个段落:绝对定位,距离顶部150px,距离左方100px


qq_慕标6304929
浏览 925回答 0
0回答

MAIN_tzboy

<style type="text/css">     *{margin:0px;padding: 0px;border:0px;}     [class*="demo"]{color: #fff;text-align: center;padding: 50px 0px;} </style> <!-- 第一段  start --> <style type="text/css"> .demo1{     position: fixed;top: 30px;left: 30px;     width: calc(100% - 30px);background-color: #882b2b; } </style> <div class="demo1">1</div> <!-- 第一段  end --> <!-- 第二段  start --> <style type="text/css"> .demo2{     position: fixed;bottom: 30px;right: 30px;     width: calc(100% - 30px);background-color: #50319c; } </style> <div class="demo2">2</div> <!-- 第二段  end --> <!-- 第三段  start --> <style type="text/css"> .demo3{     position: relative;margin-top: 30px;margin-right: -30px;     width: calc(100% - 30px);background-color: #31579c; } </style> <div class="demo3">3</div> <!-- 第三段  end --> <!-- 第四段  start --><style type="text/css"> .demo4{     position: relative;margin-top: 30px;margin-left: -30px;     width: calc(100% - 30px);background-color: #319c39; } </style> <div class="demo4">4</div> <!-- 第四段  end --> <!-- 第五段  start --><style type="text/css"> .demo5{     position: absolute;top: 150px;left: 100px;     width: calc(100% - 30px);;background-color: #f31; } </style> <div class="demo5">5</div> <!-- 第五段  end -->没看到你的预设代码…… 应该都差不多~

慕斯4360584

HDRINEXEHGQGPIZSIITDAVBOYVPPCSPMJDPHLYYSVIMMNGPCWHKROMGDGMKEBWZWVCSYZZQXXBEBVVYALLVINXHUDQZQBOLSJQLBUGDQLLFTHHHQNDKAEUHNDNGHNVQFWGWDYYLVDBVDVMQXZCGTAXAUXYZLKLYCFPMTCDXRBFFJBQOOFDMWHOVIWDQPFBWNQKRUGDBUREOQNHYDDMRXUEHLYFSPGPAQRZVUBOSFPFKSFLFCDOPYJHYHOBRVWMOYO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