Я пытаюсь отформатировать элемент HTML DIV, чтобы он реагировал на мобильные устройства. Моя цель состоит в том, чтобы погружение всегда заполняло 100% ширины и высоты любого мобильного устройства, будь то устройство ipad, iphone или androd. И.Е. экраны разных размеров.Ответственный DIV для заполнения всего экрана
Я не могу получить этот код, чтобы сделать это, однако. Где и я ошибаюсь?
Мой DIV элемент:
<!---Main Responsive DIV --->
<div class="fullscreen" id="fullscreen">
<!--- This is where we draw. --->
<div align="center" style="vertical-align:middle">
<canvas
id="canvas"
width="400"
height="250"
style="border:3px dashed #000000;">
</canvas>
</div>
<!---
This is the form that will post the drawing information
back to the server.
--->
<cfoutput>
<form action="signature_action.cfm?ticketID=#url.ticketID#&TT=#url.TT#&techID=#url.techID#&device=ipad" method="post">
<!--- The canvas dimensions. --->
<input type="hidden" name="width" value="1000" />
<input type="hidden" name="height" value="615" />
<!--- The drawing commands. --->
<input type="hidden" name="commands" value="" />
<!--- This is the export feature. --->
<!--- Navigation Elements --->
<div id="footer">
<A HREF="javascript:history.back()">Go back</A><a href="">Capture Signature</a>
</div>
</form>
</cfoutput>
</div>
Мой CSS:
#fullscreen {
height: 100vh;
width: 100vw;
position:fixed;
top:0;
left:0;
background: pink;
@
}
@media screen and (orientation:portrait) { height: 100vh;
width: 100vw; }
@media screen and (orientation:landscape) {height: 100vh;
width: 100vw; }
#footer {
position:absolute;
bottom:0;
width:100%;
height:110px; /* Height of the footer */
background:#6cf;
}
table
{
border-collapse:collapse;
}
table.borderAll
{
border-bottom: 2px solid #000;
}
tr.bottomMedium
{
border-bottom: 2px solid #000;
}
tr.bottomThin
{
border-bottom: 2px solid #000;
}
tr.bottomDouble
{
border-bottom: 2px double #000;
}
tr.last
{
border-bottom: none;
}
</style>
Я бы не сказал, что вы * имеете *, чтобы использовать их: http://caniuse.com/#search=vh – Luke
Ah .. ... Я никогда не новичок в настройках видового экрана. Thaks. –
Будет ли это автоматически изменяться, если пользователь планшета переходит из режима портретной ориентации в альбомную? –