深入了解CSS中边偏移属性top,right,bottom,left的详细用法
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了深入了解CSS中边偏移属性top,right,bottom,left的详细用法,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2285字,纯文字阅读大概需要4分钟。
内容图文
1:上边偏移属性用来定义元素顶部偏移位置的大小。top: auto | length | percent
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> CSS属性实例 </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> p{ top: 100px; position: absolute; border: 2px solid #333333; background: #666666; width: 300px; height: 50px; } </style> </head> <body> <p>这是使用边偏移属性的实例</p> </body> </html>
2:右边偏移属性right
用来定义元素右侧偏移位置的大小。right: auto | length | percent;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> css属性实例 </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> p{ right: 100px; position: absolute; border: 2px solid #333333; background: #666666; width: 300px; height: 50px; } </style> </head> <body> <p>这是使用边偏移属性的实例</p> </body> </html>
3:下边偏移属性bottom
用来定义底部偏移位置的大小。bottom:auto | length | percent;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> css属性实例 </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> p { bottom: 100px; position: absolute; border: 2px solid #333333; width: 300px; height: 50px; } </style> </head> <body> <p>这是使用下边偏移属性bottom</p> </body> </html>
4:左边偏移属性left
用来定义元素左边偏移位置的大小,left: auto | length | percent;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> p { left: 100px; position: absolute; border: 2px solid #333333; background: #666666; width: 300px; height: 50px; } </style> </head> <body> <p>这是使用左边偏移属性的实例</p> </body> </html>
以上就是深入了解CSS中边偏移属性top,right,bottom,left的详细用法的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的深入了解CSS中边偏移属性top,right,bottom,left的详细用法全部内容,希望文章能够帮你解决深入了解CSS中边偏移属性top,right,bottom,left的详细用法所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。