Адаптивный дизайн XHTML с Chrome - PullRequest
0 голосов
/ 05 июля 2018

Я использовал css grid, чтобы добавить отзывчивость.

Так как я могу проверить отзывчивость браузера Chrome? Когда я изменяю размер окна Chrome (рис. 01), он работает нормально, но когда я пытался использовать панель инструментов устройства (рис.), Он не отображается правильно.

[F12 -> (ctrl + shift + m)]

(pic 01)

(pic 0)

код HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">


<h:head>
<title>Manage App</title>
</h:head>

<h:body>

<center><h1>Employee Application Form</h1></center>  
<div class="ui-g">
    <div class="ui-g-6 ui-md-3 ui-sm-12"></div>
    <div class="ui-g-6 ui-md-6 ui-sm-12">
    <center>
        <h:form>
            <h:panelGrid columns="2" cellpadding="5">

                <h:outputLabel for="empName" value="Name :" style="font-weight:bold" />
                <p:inputText id="empName" value="#{employeeBean.empName}" />

                <h:outputLabel for="empId" value="Employee ID : " style="font-weight:bold" />
                <p:inputText id="empId" value="#{employeeBean.empId}" />

                <h:outputLabel for="age" value="Age: " style="font-weight:bold" />
                <p:inputText id="age" type="number" value="#{employeeBean.empAge}" />

                <h:commandButton value="Save" action="#{employeeBean.saveEmployee}"/>
            </h:panelGrid>
        </h:form>
    </center>
    </div>
    <div class="ui-g-6 ui-md-3 ui-sm-12"></div>
</div> 
<div >
    <p:dataTable var="emp" value="#{employeeBean.empList}">

        <p:column headerText="Employee ID">
            <h:outputText value="#{emp.empId}" />
        </p:column>

        <p:column headerText="Employee Name">
            <h:outputText value="#{emp.empName}" />
        </p:column>

        <p:column headerText="Employee Age">
            <h:outputText value="#{emp.empAge}" />
        </p:column>

    </p:dataTable>
</div> 

<h3>Sample Layout</h3>
<div class="ui-g">
    <div class="ui-g-12 ui-md-2" style="background: radial-gradient(circle,grey,blue);">Menu</div>
    <div class="ui-g-12 ui-md-10 ui-g-nopad">
        <div class="ui-g-12">
            Bar
        </div>
        <div class="ui-g-12 ui-g-nopad">
            <div class="ui-g">
                <div class="ui-g-12 ui-md-4">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet, orci nec dictum convallis, ligula mauris vestibulum turpis, nec varius tortor quam at diam. Nullam a viverra nibh. In tincidunt tempor lectus quis vulputate. Pellentesque nec dui aliquam, lobortis est in, lobortis ante</div>
                <div class="ui-g-12 ui-md-4">Maecenas vel nisi aliquet, vulputate tortor id, laoreet massa. Maecenas mattis tristique bibendum. Suspendisse vel mi dictum, vestibulum lacus quis, pulvinar quam. Proin vulputate, nibh at finibus varius, leo eros lacinia elit, nec blandit odio tellus a justo. Donec nec ex auctor, tristique nulla nec, rutrum sapien.</div>
                <div class="ui-g-12 ui-md-4">Proin efficitur in leo eget ornare. Nam vestibulum neque sed velit sagittis sodales. Sed scelerisque hendrerit magna a hendrerit. Cras tempor sem at justo pharetra convallis. Curabitur vel sodales purus. Vestibulum interdum facilisis nulla imperdiet suscipit. Quisque lectus felis, condimentum eget hendrerit sit amet.</div>
            </div>

            <div class="ui-g">
                <div class="ui-g-6 ui-md-4 ui-sm-12"><p:graphicImage name="images/mock.jpg" style="width:100%"/></div>  
                <div class="ui-g-6 ui-md-4"><h:graphicImage library="images" name="mock.jpg"  style="width:100%" /></div> 
                <div class="ui-g-6 ui-md-4"><p:graphicImage name="images/mock.jpg" style="width:100%"/></div>      
            </div>

            <div class="ui-g">
                <div class="ui-g-12 ui-md-6">Phasellus faucibus purus volutpat mauris lacinia sodales. Ut sit amet sapien facilisis, commodo dui non, fringilla tellus. Quisque tempus facilisis nisi sodales finibus. Pellentesque neque orci, ullamcorper vitae ligula quis, dignissim euismod augue.</div>
                <div class="ui-g-12 ui-md-6">Fusce ullamcorper congue massa, eget ullamcorper nunc lobortis egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ultrices dui eget dolor feugiat dapibus. Aliquam pretium leo et egestas luctus. Nunc facilisis gravida tellus.</div>
            </div>
        </div>
    </div>
    <div class="ui-g-12">
        Footer
    </div>
</div>

Может кто-нибудь дать несколько советов. Спасибо

...