选择智能手机上的尺寸有正常尺寸 [英] Select size on smartphone have normal dimension

查看:103
本文介绍了选择智能手机上的尺寸有正常尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的web应用程序中,我创建了一个具有 size:5 的选择,正确显示如何从图像中看到:





当我在手机上打开应用程序时,我得到了这个维度:





如何看到大小不正确。我通过代码设置维度,而不是在CSS中。


JSFIDDLE



CODE:

 < select style ='width:200px'size =5>< / select> 


解决方案

您必须在css中设置媒体以允许它在移动设备中正确打开,如果您使用的是引导程序,它已经适合移动设备的布局。如果没有,你必须手动指定它。

  @media屏幕和(max-height:480px)和(orientation:portrait){
.text-框
{width:200px;
尺寸:5;

$ / code>

在您的html中:

 < select class =text-box>< / select> 

Happy Coding ..;)

in my web application I have created a select that have size: 5, is displayed correctly how you can see from the image:

When I open the app on mobile I get instead this dimension:

How you can see the size isn't taken correctly. I set the dimension through code and not in the css. I repeat, this is working on desktop but not in mobile, why does this happen?

JSFIDDLE

CODE:

<select style='width:200px' size="5"></select>

解决方案

you have to set the media in css to allow it to open correctly in mobile device, if you are using bootstrap, it is already fit the layout of mobile. if not you have to specify it manually.

    @media only screen and (max-height:480px) and (orientation:portrait) { 
    .text-box
     { width: 200px; 
       size: 5;
     }

In your html:

<select class="text-box"></select>

Happy Coding.. ;)

这篇关于选择智能手机上的尺寸有正常尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆