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進行上下分開,否則導航欄會將其覆蓋