如何用css 將div 中的span 右對齊
- float
- flex & justify-content
- absolute
添加float
div {
span {
float: right;
}
}
添加flex
div {
display: flex;
justify-content: space-between;
}
添加absolute
div {
position: relative;
span {
position: absolute;
right: 0;
}
}
暫時就想到這些,還有其它更巧妙的方式,歡迎大家留言交流。。。