一个css问题_html/css_WEB-ITnose

html页面*{padding: 0;margin: 0}#main{width:auto;height: auto;background-color: #ccc;position: relative;padding: 20px;}#left{position: absolute;width: 300px;height: 500px;background-color: blue;}#right{margin: 0 0 0 330px;background-color: yellow;}#footer{width: auto;height: 100px;background-color: orange;text-align: center;}
左边
右边
底部

登录后复制
问题是:footer怎么样下沉到最底部
我想要达到的效果是:
—–“右边”高度和宽度自适应,窗口变化时自动跟着变化

回复讨论(解决方案)

主要是position:fixed这个属性

谢谢楼上的兄弟,已经用另外的方法解决了

html页面*{padding: 0;margin: 0}#main{width:auto;height: auto;background-color: #ccc;padding: 20px;overflow: auto;}#left{float:left;width: 300px;height: 500px;background-color: blue;position: relative;}#right{background-color: yellow;margin-left: 330px;}#footer{width: auto;height: 100px;background-color: orange;text-align: center;clear:both;}
左边
右边
底部

登录后复制

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2843731.html

(0)
上一篇 2025年3月10日 06:10:42
下一篇 2025年3月10日 06:10:55

AD推荐 黄金广告位招租... 更多推荐

相关推荐

发表回复

登录后才能评论