日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

css属性基础以及wxss——居中,渐变色边框,圆角边框,横向布局,重叠div,div固定在底部,input的无边框显示下划线

發布時間:2023/12/10 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 css属性基础以及wxss——居中,渐变色边框,圆角边框,横向布局,重叠div,div固定在底部,input的无边框显示下划线 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

text-align: center;——子item居中對齊

display: flex;——子item橫向布局

-webkit-justify-content: center;——子item居中

margin: auto;——子item居中

?

background: #f4f4f4;——背景色(background-color: yellowgreen;)

opacity: 0.5;——透明度


?border-top: 0.13333rem solid #a1c9f8;——邊界寬度及顏色(上邊框)

?border: 1px solid #fff;——全邊框
?border-color: #0CD5E5 #0CD5E5 #0CD5E5 #0CD5E5;——四色邊框(漸變色)

?border-radius: 16px;——圓角邊框

?

style="background-image:url(images/mybg.png) ;height: 250px——背景圖片

<img src="image/01.jpg" height="270" width="479" >——加載圖片

letter-spacing:5px;——文本間距

?

(1)重疊布局

div實例

<div class="bigDiv"><div class="smallDiv1"></div><div class="smallDiv2"></div> </div>

css實現重疊布局

.bigDiv{
? ? position: relative;
}
.smallDiv1{
? ? position: absolute;
? ? z-index: 2;
}
.smallDiv2{
? ? position: absolute;
? ? z-index: 1;
}

附:

1、子絕父相:兒子絕對定位,父親相對定位
2、z-index:層次;值越大放置越靠上

?

(2)div固定在底部css

.footer{
height: 20px;
width: 100%;
? display: flex;
position: fixed;
bottom: 0;
text-align: center;
}

(3)input的無邊框顯示下劃線

.inputclass{
? ? border: none;
? ? font-size: 15px;
? ? height: 20px;
? ? width: 100%;
? ? margin-top: 3px;
? ? letter-spacing:5px;
? ? margin-left:12px;
? ? margin-right: 40px;
? ? padding-bottom: 5px;
? ? border-bottom: 1.5px solid #DBDBDB;
}

(4)相對定位與絕對定位布局

母層使用相對布局:

?? ?position: relative;

子層使用絕對布局,位居底部

?? ?.box .bg{
?? ??? ?background-color: #000;
?? ??? ?opacity: 0.5;
?? ??? ?width: 100%;
?? ??? ?height: 40px;
?? ??? ?/* 絕對定位 */
?? ??? ?position: absolute;
?? ??? ?bottom:0px;
?? ??? ?
?? ??? ?/* 層級: */
?? ??? ?z-index:100; ?/* ?-999-0+999 */
?? ??? ?}

?

?

?

?

?

?

微信小程序——wxss:

flex-direction: row;——橫向布局

flex-direction: column;——縱向布局+display: flex;

flex: 1;——————————單行

justify-content: space-between;——item平分母尺寸居中顯示

border-bottom: 1px solid rgb(197, 199, 199);——item底部分割線

?

總結

以上是生活随笔為你收集整理的css属性基础以及wxss——居中,渐变色边框,圆角边框,横向布局,重叠div,div固定在底部,input的无边框显示下划线的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。