簡體   English   中英

為什么我的移動網站上的按鈕不成比例?

[英]Why are the buttons on my mobile site not proportional?

我的移動網站上的按鈕與屏幕完全不成比例。 我不知道為什么它們這么小。 下圖。

這是所有相關的CSS:

    <style type="text/css" media="handheld, only screen and (max-device-width: 700px)">
        #onbutton {
            -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
            -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
            box-shadow:inset 0px 1px 0px 0px #ffffff;
            background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
            background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
            background-color:#ededed;
            border-radius: 6px;
            text-indent:0;
            border:1px solid #dcdcdc;
            width: 100%;
            color:#777777;
            font-family:arial;
            font-size:15px;
            font-weight:bold;
            font-style:normal;
            height:50px;
            line-height:50px;
            text-decoration:none;
            text-align:center;
            text-shadow:1px 1px 0px #ffffff;
        }
        #onbutton:hover {
            background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
            background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
            background-color:#dfdfdf;
        }
        #onbutton:active {
            position:relative;
            top:1px;
            background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b9b9b9), color-stop(1, #cecece) );
        }

        #status {
            width: 100%;
            opacity: 0;
            text-align: center;
            font-family: sans-serif;
            border-width: 1px;
            border-style: solid;
            border-radius: 6px;
            padding-top: 10px;
            padding-bottom: 10px;
        }

        #status.off {
            background-color: #ff5353;
            border-color: #ff1515;
        }

        #status.on {
            background-color: #9eda97;
            border-color: #11ab0c;
        }
    </style>

這是HTML:

<body>
    <div id="main">
        <input type="button" value="Start computer" id="onbutton"></input>
        <br/>
        <br/>
        <div id="status" class="on" style="opacity:1">Hello</div>
    </div>
</body>

圖片

您是否在尋找移動元視口標簽?

<meta name="viewport" content="width=device-width,initial-scale=1.0" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM