CSS 实现子元素在相对定位父元素的最左侧
可以使用子元素的 'left' 属性设置为 0,同时使用绝对定位来实现:
.parent {
position: relative;
text-align: center; /*居中*/
}
.child {
position: absolute;
left: 0; /*屏幕最左侧*/
}
原文地址: http://www.cveoy.top/t/topic/mJJu 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
可以使用子元素的 'left' 属性设置为 0,同时使用绝对定位来实现:
.parent {
position: relative;
text-align: center; /*居中*/
}
.child {
position: absolute;
left: 0; /*屏幕最左侧*/
}
原文地址: http://www.cveoy.top/t/topic/mJJu 著作权归作者所有。请勿转载和采集!