Как объявить высоту на основе экрана с системой дизайна? - PullRequest
0 голосов
/ 07 декабря 2018

Я нашел вложенность столбцов в сетке, чтобы я мог сделать следующее представление:

(Ресурс: https://www.lightningdesignsystem.com/utilities/grid/#Column-Nesting) введите описание изображения здесь Но у меня есть проблема.

Когда я устанавливаю единицу высоты как «px», я могу применить высоту к div.И столбцы и строки таблицы применяются с единицей высоты как «процент»

С другой стороны, когда я устанавливаю единицу высоты как «процент», я не могу применить высоту с единицей высоты как«процент» в элементах div, столбцах, строках и таблице!

Я хочу создать экранную отзывчивую страницу visualforce.

Как применить высоту в «процентах»?

Мой код следующий:

<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>

1 Ответ

0 голосов
/ 07 декабря 2018

/ ************** ipad rotate *************** /

@ media (максимальная ширина: 1080px) {}

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

@ только для мультимедиаэкран и (минимальная ширина: 768 пикселей) и (максимальная ширина: 1024 пикселей) и (ориентация: портрет) {}

/ ************** iphone rotate *************** /

@ media (max-width: 767px) {}

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

@ media (max-width: 479px) {}

Вы должны стилизовать на основе ширины устройстваиспользуя вышеуказанное условие, если у вас все еще есть сомнения по поводу стиля, дайте мне знать .... Спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...