1
paparika OP 大致这种感觉
| | | icon text | | | |
2
paparika OP 上个楼作废,大致这种感觉 |*icon***text********|
|
3
chenno9 2018-03-30 15:27:05 +08:00
<!DOCTYPE html>
<html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .wrapper{ width: 100%; display: flex; background-color: #ccc; justify-content: center; } .icon{ width: 200px; background-color: red; margin-right: 50px; } .text{ width: 500px; background-color: yellow; } .blank{ width: 250px; } </style> </head> <body> <div class="wrapper"> <div class="icon">icon</div> <div class="text">text</div> <div class="blank"></div> </div> </body> </html> |
4
chenno9 2018-03-30 15:34:29 +08:00
|
5
rabbbit 2018-03-30 15:49:31 +08:00
一定要用 flex 吗?
<view class="wrapper"> <!-- <image class="icon" src='../../images/ic.png'></image> --> <view class="text">text</view> </view> .wrapper { display: block; background: #ff0; width: 100%; justify-content: center; } .text { margin: 0 auto; display: block; width: 50px; height: 50px; border:1px solid black; position:relative; } .text:before { background: #fff url(../../images/ic.png); content: ""; display: block; width: 50px; height: 50px; border: 1px solid black; position: absolute; left: -100px; } |
6
paparika OP 结贴
|