简体   繁体   English

响应式屏幕尺寸在小屏幕上播放

[英]Responsive screen size has play when on small screen

all.全部。

I have read many threads, I however, am at an impass.我已经阅读了很多主题,但是我陷入了僵局。

I have built a website with React, which I hope it is OK to link.我用 React 建了一个网站,希望可以链接。

https:ishaqamin.dev https:ishaqamin.dev

When I am on a mobile device, the screen can be moved around and shows white around the sides.当我在移动设备上时,屏幕可以四处移动并在两侧显示白色。

I have tried;我努力了;

  1. height: 100%高度:100%
  2. height:100vh高度:100vh
  3. minHeight:100vh最小高度:100vh

It does not seem to stop it.它似乎并没有阻止它。

I would prefer, on mobile, if the screen was fixed and did not move around.如果屏幕是固定的并且没有移动,我更喜欢在移动设备上。

Home screen settings:主屏幕设置:

    <div style={{display:'flex',flexDirection:'column' ,alignItems:'center', width:'100%', minHeight:'100vh',backgroundColor:'black', padding:20}}>
        <Paper elevation={3} style={{display:'flex',flexDirection:'column', height:'95%', width:'90%', backgroundColor:'black',padding:10}}>

Any ideas?有任何想法吗?

在此处输入图像描述 在此处输入图像描述

You are giving padding 20px and width: 100% just made padding 0 check now你给 padding 20px 和 width: 100% just made padding 0 check now

图像

use css reset codes:使用 css 重置代码:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM