Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML页面不';t安装移动设备屏幕_Html_Css_Mobile - Fatal编程技术网

HTML页面不';t安装移动设备屏幕

HTML页面不';t安装移动设备屏幕,html,css,mobile,Html,Css,Mobile,这是我的HTML: 试验 身体{ 字体大小:40px; } .屏幕{ 字体大小:0.5em; 保证金:0; 背景色:红色; 位置:绝对位置; 宽度:8em; 高度:19公分; 左:0; 排名:0; } .screen.main{ 宽度:100%; 身高:100%; } 我们的利益是自由的,我们的利益是自由的,我们的利益是自由的,我们的利益是自由的,我们的利益是非特殊的,我们的利益是自由的,我们的利益是自由的,我们的利益是自由的。 您将屏幕的宽度设置为8em,将其更新为100%: .scree

这是我的HTML:


试验
身体{
字体大小:40px;
}
.屏幕{
字体大小:0.5em;
保证金:0;
背景色:红色;
位置:绝对位置;
宽度:8em;
高度:19公分;
左:0;
排名:0;
}
.screen.main{
宽度:100%;
身高:100%;
}
我们的利益是自由的,我们的利益是自由的,我们的利益是自由的,我们的利益是自由的,我们的利益是非特殊的,我们的利益是自由的,我们的利益是自由的,我们的利益是自由的。

您将
屏幕的宽度设置为
8em
,将其更新为
100%

.screen {
    font-size: 0.5em;
    margin: 0;
    background-color: red;
    position: absolute;
    width: 100%;
    height: 19em;
    left: 0;
    top: 0;
}
您还需要(可能,除非您使用CSS重置)删除
正文上的
边距和
填充:

body {
    font-size: 40px;
    margin: 0;
    padding: 0;
}
试试这个

body {
margin:0;
padding:0;
}

除了BenM的答案之外,在css中设置此选项可以从浏览器中删除默认样式

html, body {
     font-size: 40px;      
     margin:0; /* remove default margin */
     padding:0; /* remove default padding */
     width:100%; /* take full browser width */
     height:100%; /* take full browser height*/
}
因此,完整的css应该:

  .screen {
                font-size: 0.5em;
                margin: 0;
                background-color: red;
                position: absolute;
                width: 100% /* BenM mentioned this in answer*/
                height: 100%; /* take full browser height */
                left: 0;
                top: 0;
            }

  .screen .main {
                width: 100%; /* <--now this takes full browser dimension  */
                height: 100%; /* <--now this takes full browser dimension  */
            }
屏幕{
字体大小:0.5em;
保证金:0;
背景色:红色;
位置:绝对位置;
宽度:100%/*BenM在回答中提到了这一点*/
高度:100%;/*采用全浏览器高度*/
左:0;
排名:0;
}
.screen.main{
宽度:100%/*