如何使用设计系统基于屏幕声明高度



我找到了Grid的Column Nesting,这样我就可以创建以下视图:

(资源:https://www.lightningdesignsystem.com/utilities/grid/#Column-嵌套(

在此处输入图像描述

但我有个问题。

当我将高度单位设置为"px"时,我可以在div上应用高度。表格的列和行应用高度单位为"百分比">

另一方面,当我将高度单位设置为"百分比"时,我不能在div、列、行和表上应用高度单位为"百分比"的高度!

我想创建一个基于屏幕的响应可视化页面。

如何应用"百分比"形式的高度?

我的代码如下:

<apex:page showHeader="false" standardStylesheets="false"
sidebar="false" applyHtmlTag="false" applyBodyTag="false"
docType="html-5.0">
<html xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Condition of Operating Room of Mods Clinic</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Import the Design System style sheet -->
<apex:slds />
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.operating {
height: 750px;
background-color: blue;
}
.logoAndExplaination {
height: 150px;
background-color: green; 
}
.nonOperating {
height: 600px;
background-color: orange;
}
.waiting{
margin-top: 0;
margin-bottom: 0;
height: 300px;
background-color: fuchsia;
}
.end {
margin-top: 0;
height: 300px;
background-color: silver;
}
table {
border-collapse: collapse;
margin: 2.5px;
}
th {
border: 1px solid black;
}
td {
border: 1px solid black;
}
</style>
</head>
<body>
<!-- REQUIRED SLDS WRAPPER -->
<div class="slds-scope">
<!-- PRIMARY CONTENT WRAPPER -->
<div class="slds-grid slds-wrap">
<div class="operating slds-col slds-size_2-of-3">
<table style="width: 99%; height: 99%;">
<colgroup>
<col width="25%" />
<col width="25%" />
<col width="25%" />
<col width="" />
</colgroup>
<tr style="height: 5%;">
<th>501호</th>
<th>502호</th>
<th>503호</th>
<th>504호</th>
</tr>
<tr style="height: 28.3%;">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 5%;">
<th>101호</th>
<th>102호</th>
<th>103호</th>
<th>104호</th>
</tr>
<tr style="height: 28.3%;">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 5%;">
<th>수술실 1</th>
<th>수술실 2</th>
<th>수술실 3</th>
<th>레이저실(107호)</th>
</tr>
<tr style="height: 28.3%;">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="slds-col slds-size_1-of-3">
<div class="slds-grid slds-wrap">
<div class="logoAndExplaination slds-col slds-size_1-of-1" align="center">
<img alt="Image"
src=""
style="width: 90%;" />
<h1 style="color: white; margin: 0; padding: 0; margin-bottom: 5px">상 황 판</h1>
</div>
<div class="nonOperating slds-col slds-size_3-of-4">
<table style="width: 99%; height: 98%;">
<colgroup>
<col width="33%" />
<col width="33%" />
<col width="" />
</colgroup>
<tr style="height: 7.5%;">
<th>메디짐 운동실</th>
<th>메디짐 치료실</th>
<th>회복실1(105호)</th>
</tr>
<tr style="height: 25.83%;">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 7.5%;">
<th>상담실1</th>
<th>상담실2</th>
<th>회복실2(107호)</th>
</tr>
<tr style="height: 25.83%;">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="height: 7.5%;">
<th>상담실3</th>
<th>상담실4</th>
<th>미팅룸</th>
</tr>
<tr style="height: 25.83%;">
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="slds-col slds-size_1-of-4">
<div class="waiting slds-col slds-size_1-of-1">
<table style="width: 98%; height: 99%;">
<tr style="height: 15%;">
<th>대기자</th>
</tr>
<tr style="height: 85%;">
<td></td>
</tr>
</table>
</div>
<div class="end slds-col slds-size_1-of-1">
<table style="width: 98%; height: 96%;">
<tr style="height: 15%;">
<th>시술마침</th>
</tr>
<tr style="height: 85%;">
<td></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- / PRIMARY CONTENT WRAPPER -->
</div>
<!-- / REQUIRED SLDS WRAPPER -->
<!-- JAVASCRIPT -->
<!-- / JAVASCRIPT -->
</body>
</html>
</apex:page>

/**************ipad旋转***************/

@介质(最大宽度:1080px({}

/**************ipad***************/

@仅媒体屏幕和(最小宽度:768px(和(最大宽度:1024px(以及(方向:纵向({}

/**************iphone旋转***************/

@介质(最大宽度:767px({}

/**************iphone***************/

@介质(最大宽度:479px({}

使用上述条件,您必须根据设备宽度进行造型,如果您对造型仍有疑问,请告诉我。。。。谢谢

最新更新