python :HTML+CSS (Position)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了python :HTML+CSS (Position),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2669字,纯文字阅读大概需要4分钟。
内容图文
position_fixed固定在某一个页面上
<! DOCTYPE html > < html lang ="en" > < head > < meta charset ="UTF-8" > < title >Title</title><style> .pg_head{ height: 60px; background-color: black; color: white; position: fixed;/*position头部固定*/ top :0; left:0; right:0;} .pg_body{ background-color:#dddddd; height: 5000px; margin-top: 20px;}</style></head><body><!--position fixed--><div class="pg_head"> 头部</div><div class="pg_body">内容</div></body></html>
position中 relative和 absolute的结合使用
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > < html > < head > < title >Title</title></head><body><div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;"><div style="position: absolute;left:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div></div><div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;"><div style="position: absolute;right:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div></div><div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;"><div style="position: absolute;right:0;top:0;width: 50px;height: 50px;background-color: black;"></div></div></body></html>
IE浏览器显示图片是有蓝色边框的
<! DOCTYPE html > < html lang ="en" > < head > < meta charset ="UTF-8" > < title >Title</title><style> img { border: 0;}</style></head><body><div><!--默认img图片有蓝色的边框,如果border: 0;就可以去掉--><a href="http://www.baidu.com"><img src="7.png" style="width: 820px; " alt="mei"/><!--或者--><img src="7.png" style="width: 820px;border: 0; " alt="mei"/></a></div></body></html>
overflow图片显示不完全,现实滚动条
<! DOCTYPE html > < html lang ="en" > < head > < meta charset ="UTF-8" > < title >Title</title></head><body><!--<div style="width:100px;height: 100px; overflow: hidden">--><!-- 按外面的大小隐藏图片大小overflow: hidden--><div style="width:100px;height: 100px; overflow: auto"><!--图片大小带滚动条overflow: auto--><div><a><img src="7.png"/></a></div></div></body></html>
原文:http://www.cnblogs.com/xuehuahongmei/p/6076038.html
内容总结
以上是互联网集市为您收集整理的python :HTML+CSS (Position)全部内容,希望文章能够帮你解决python :HTML+CSS (Position)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。