
div使用了position:fixed怎样才能让div居中,可以这样来实现:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<style>
.aa<br />{<br />    position: fixed;<br />    top: 0px;<br />    left: 0px;<br />    right: 0px;<br />    width: 200px;<br />    height: 200px;<br />    margin-left:auto;<br />    margin-right:auto;<br />}
<p>.bb {<br />    border: solid yellow;<br />    background: red;<br />    z-index:9988;<br />}</p>
</style>
<script type="text/javascript">
</script>
 
<div class="aa">
<div class="bb">aaabbbcccdddeeefffggghhhiiijjjkkklll</div>
<div class="bb">胡适的杂文很好看</div>
<div class="bb">或者,你可以看看林语堂的小说</div>
</div>
 
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/261423.html
