子级绝对定位也受父级宽度的影响
来源:互联网 发布:移动巡检软件 编辑:程序博客网 时间:2024/06/05 04:45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
*{
margin: 0;
padding: 0;
}
.txt{
display: inline-block;
height:30px;
line-height: 30px;
border:1px solid #498fd3;
background: #276AB0;
outline: none;
}
.close{
position: relative;
display: inline-block;
}
.close>.icon{
display: inline-block;
width: 30px;
height: 30px;
line-height: 30px;
border:1px solid #498fd3;
background: #276AB0;
}
.close>.span{
display: inline-block;
position: absolute;
top: 30px;
left: 0;
height: 40px;
/*white-space: nowrap;*/
}
.block{
display: inline-block;
}
</style>
</head>
<body>
<div class="block">
<button class="txt">fffffffff</button>
<div class="close">
<span class="icon">×</span>
<span class="span">啊对方噶啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>
</div>
</div>
</body>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
*{
margin: 0;
padding: 0;
}
.txt{
display: inline-block;
height:30px;
line-height: 30px;
border:1px solid #498fd3;
background: #276AB0;
outline: none;
}
.close{
position: relative;
display: inline-block;
}
.close>.icon{
display: inline-block;
width: 30px;
height: 30px;
line-height: 30px;
border:1px solid #498fd3;
background: #276AB0;
}
.close>.span{
display: inline-block;
position: absolute;
top: 30px;
left: 0;
height: 40px;
/*white-space: nowrap;*/
}
.block{
display: inline-block;
}
</style>
</head>
<body>
<div class="block">
<button class="txt">fffffffff</button>
<div class="close">
<span class="icon">×</span>
<span class="span">啊对方噶啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>
</div>
</div>
</body>
</html>
想要文字在一行显示把white-space放开,但是只能是文字,显示不受宽度影响
0 0
- 子级绝对定位也受父级宽度的影响
- 消除绝对定位的影响
- css绝对定位 自适应宽度的问题
- margin对css绝对定位的影响
- CSS3-transform-transform影响子级的固定定位
- CSS中绝对定位对子元素height的影响
- 浮动和绝对定位对布局的影响
- 绝对定位:子元素进行了绝对定位会不会跳出父级元素。
- 绝对定位absolute,可以用left:50%加上margin-left:(宽度/2),来实现绝对定位的居中
- 绝对定位居中,宽度多宽都没事
- 固定在左上角,固定宽度,采用的是绝对(absolute)定位
- 层的绝对定位
- 绝对定位的特点
- css的绝对定位
- 相对、绝对、固定定位,以及其层级关系和脱离文档流的影响
- 绝对定位的DIV绝对居中显示
- css布局:父元素相对定位,子元素绝对定位
- IE6 下父级(relative)使用padding后,子元素绝对定位(absolute)的bug
- Windows性能计数器解释
- 欢迎使用CSDN-markdown编辑器
- zookeeper Lilux部署问题
- xshell拖动上传文件至linux服务器
- 「代码家」的学习过程和学习经验分享
- 子级绝对定位也受父级宽度的影响
- 百度团队前端自动化工程工具fis-parser-node-sass插件安装失败的解决方案
- Dijkstra,记忆化搜索(林中漫步,UVA 10917)
- (37)Spring Boot集成EHCache实现缓存机制【从零开始学Spring Boot】
- mysql数据库优化
- 孙子兵法-谋攻篇
- 跳槽前,注意事项
- 使用指针法对数组进行冒泡排序、选择排序、插入排序法、二分查找法
- (38)Spring Boot分布式Session状态保存Redis【从零开始学Spring Boot】