The core attitude of writing css layout

Just be flexible. If you can’t float, just position, if you can’t position, just flex. Anyway, as long as you can write it out.

 

css

.paihang{
  background:#CCC;
  width:100%;
}
.paihang-desc {
  position: relative;
  padding: 10rpx 10rpx;
  width: 100%;
  height: 100rpx;
  line-height: 100rpx;
  border: 1px solid red;
}
.fr {
 position: absolute;
 right: 20rpx;
 top:50%;
 margin-right: 20rpx;
 transform: translateY(-50%);
 border: 1px solid red;
 border-radius: 14rpx;
 padding: 10rpx;
 height: 40rpx;
 font-size:28rpx;
 line-height: 40rpx;
}

Guess you like

Origin blog.csdn.net/qq_15009739/article/details/112461966