dssdfsdfsdfsdf
我需要两个div看起来有点像这样:
| | ---| LOGO |------------------------ | |_______________| LINKS | | CONTENT |
什么是使它们整齐重叠的最佳/最优雅方式?徽标将具有固定的高度和宽度,并将触及页面的顶部边缘.
我可能会这样(CSS和HTML):
html,
body {
margin: 0px;
}
#logo {
position: absolute; /* Reposition logo from the natural layout */
left: 75px;
top: 0px;
width: 300px;
height: 200px;
z-index: 2;
}
#content {
margin-top: 100px; /* Provide buffer for logo */
}
#links {
height: 75px;
margin-left: 400px; /* Flush links (with a 25px "padding") right of logo */
}
dssdfsdfsdfsdf
只需使用负边距,在第二个div中说:
并确保设置z-index属性以获得所需的分层.
这是迄今为止最简单的方法,并且可以通过在页面内容上使用margin-bottom轻松地适应重叠的页脚.谢谢!
这应该是公认的答案,绝对位置容易引起问题。推荐阅读
如何解决《如何使用接近传感器拍照?》经验,为你挑选了0个好方法。 ... [详细] 如何解决《重新采样pandas数据帧正在删除列》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在Cordova中使用handleOpenURL和自定义URL方案》经验,为你挑选了2个好方法。 ... [详细] 如何解决《如何检测Haskell管道中的最后一个块?》经验,为你挑选了0个好方法。 ... [详细] 如何解决《从MainActivity类中的另一个函数访问WebView》经验,为你挑选了2个好方法。 ... [详细] 如何解决《AjaxPOST导致405(方法不允许)-SpringMVC》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何制作具有在线模式的IOS应用程序?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《使用nodejsawssdk将生成的pdf上传到AWSS3》经验,为你挑选了1个好方法。 ... [详细] 如何解决《我们如何确定IP地址的类别?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《PhalconMicro应用程序无法使用查询字符串正确路由》经验,为你挑选了1个好方法。 ... [详细] 如何解决《找一个GameObjectsVector3》经验,为你挑选了1个好方法。 ... [详细] 如何解决《打印预格式化的数组,不带<pre>标签》经验,为你挑选了1个好方法。 ... [详细] 如何解决《除以0后,在numpy数组中将NaN替换为0》经验,为你挑选了2个好方法。 ... [详细] 如何解决《这与ObjectWrap::Unwrap的持有人》经验,为你挑选了0个好方法。 ... [详细] 如何解决《如何通过字符串键获取嵌套JavaScript对象属性的值》经验,为你挑选了1个好方法。 ... [详细] 如何解决《是否可以(或有效)使用AWSLambda运行完整的后端(比如说,ElasticBeanstalk)》经验,为你挑选了3个好方法。 ... [详细] 如何解决《ApacheNIFiMergeContent处理器-将分界符设置为新行》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何使用pythonwin32gui启用制表符和箭头键》经验,为你挑选了0个好方法。 ... [详细] 如何解决《在Spring中区分未经身份验证的用户》经验,为你挑选了1个好方法。 ... [详细] 如何解决《为什么我的RxJavaObservable不会发出或完成,除非它被阻止?》经验,为你挑选了0个好方法。 ... [详细]吐了个 "CAO" !Tags | 热门标签RankList | 热门文章
- 1即使在使用pack()之后,winfo_width()也返回1
- 2将数据库导入DataGrip(0xDBE)
- 3如何在SQL Server 2008中将数据转换为json格式?
- 4行尾(GNU文档)
- 5scikit学习系数多项式特征
- 6Vim折叠,没有结束标记
- 7从深层嵌套的目录结构导入模块
- 8我在android studio中构建gradle时遇到错误
- 9分段方形的矢量,C++ Eigen中两个向量的分段产品
- 10C中的黄金比例?
- 11在快速的bezier路径圆中舍入笔划的边缘
- 12Swift 2:'Set <UITouch>'类型的值没有成员'anyObject'
- 13如何使用addClass和removeClass在Class之间切换?
- 14使用swift编译器裸机?
- 15Python函数返回索引0处的值?
- 16块执行时EXC_BAD_ACCESS
- 17在table-cell元素中使用float属性会将先前的内容向下滑动
- 18在Algolia指数中搜索确切的术语
- 19Laravel 5使用前缀路由
- 20我可以从后台线程更新UI,为什么?
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有