语义反应/高度100%,页面[关闭]

问题描述 投票:-1回答:2

我正在尝试使菜单占据屏幕高度的100%,但我不能这样做

我的沙子:https://codesandbox.io/s/brave-http-wiu8u

css semantic-ui
2个回答
1
投票

您需要更新CSS以便使用以下CSS将高度匹配应用于屏幕:codesandbox

CSS

html,
body {
  height: 100vh !important;
}

#root,
.App,
.ui.fluid.container,
.ui.grid,
.ui.menu {
  height: 100% !important;
}

.ui.menu {
  border-radius: 0px !important;
  border: 0px !important;
  box-shadow: none !important;
  background-color: #252631 !important;
}

.ui.menu .item {
  padding: 8px !important;
}

.ui.button .icon {
  margin-left: 5px !important;
  margin-right: 15px !important;
  background-color: transparent !important;
}

.btnMenu {
  width: 100% !important;
  height: 50px;
  color: white !important;
  text-align: left !important;
  margin: 0 !important;
  background-color: transparent !important;
}

.btnMenu:hover {
  color: white !important;
  background-color: rgba(186, 186, 186, 0.4) !important;
}

.logo {
  height: 60px;
  width: 100% !important;
}

.ui.vertical.menu .item {
  display: flex !important;
  align-items: center !important;
}

.ui.divider {
  height: 2px !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
}

/*ui container*/

.menu {
  padding: 0 !important;
  margin: 0 !important;
  width: 240px !important;
}

1
投票

可能有帮助

.menu {
  padding: 0 !important;
  margin: 0 !important;
  width: 240px !important;
  height: 100%;
}

  <Container fluid style={{height: "500px", background: "#000" }}>
© www.soinside.com 2019 - 2024. All rights reserved.