瀏覽代碼

React项目: 布局样式微调

大侠 2 年之前
父節點
當前提交
e0157b88df
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 7 0
      15_React/day-7/code/my-app/src/index.css
  2. 4 3
      15_React/day-7/code/my-app/src/layout/index.css

+ 7 - 0
15_React/day-7/code/my-app/src/index.css

@@ -5,9 +5,16 @@ body {
     sans-serif;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
+  width: 100vw;
+  height: 100vh;
 }
 
 code {
   font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
     monospace;
 }
+
+#root {
+  width: 100%;
+  height: 100%;
+}

+ 4 - 3
15_React/day-7/code/my-app/src/layout/index.css

@@ -1,6 +1,6 @@
 .layout {
-  width: 100vw;
-  height: 100vh;
+  width: 100%;
+  height: 100%;
 
   display: flex;
 }
@@ -38,5 +38,6 @@
 }
 
 .ant-menu {
-  min-height: 100vh;
+  box-sizing: border-box;
+  height: 100%;
 }