uni-app css相關樣式總結(1)


1、將兩個view元素分左右對齊  

  (1) display: flex;justify-content: space-between;

  (2) display: flex;flex-direction: row;然后通過width(%),text-align:center/right等進行調節

2、垂直居中 

  父元素:display: flex;  子元素:align-self: center;

3、水平居中 

  text-align: center; 子元素是文本(非塊元素)

  margin: 0px auto; 子元素為塊元素(div,view)

4、頭部導航欄、底部導航欄

  可以通過 position: fixed;z-index: 100;left: 0px;top: 0px;width: 100%;height: 60px;background-color: white;自定義

  頭部導航欄:下一個塊元素需要用margin-top進行上下分開,否則導航欄會將其覆蓋


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM