有没有一种方法可以消除右边的垂直白线?

时间:2020-10-31 14:06:57

标签: javascript html css

我无法解决此CSS问题,我使我的网站处于反应状态,但在移动版本中,我发现了此问题,当我缩小屏幕时,您会在右侧看到此垂直白线。 Screenshot

我试图到处寻找解决方案,大多数人说将保证金:0,填充:0,但是什么也没有。

在我的app.css中:

isEqualTo(expected)

有办法吗?谢谢!

2 个答案:

答案 0 :(得分:0)

专门在body上设置样式

body {
   margin: 0,
   padding: 0,
}

答案 1 :(得分:-1)

那是我的主要目的

import React from 'react';
import './App.css';
import Home from './components/pages/HomePage/Home';
import Services from './components/pages/Services/Services';
import Products from './components/pages/Products/Products';
import Contattaci from './components/pages/Contattaci/Contattaci';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Navbar from './components/Navbar';
import Footer from './components/pages/Footer.js/Footer';
import Terms from './components/Terms';
import CookieConsent, { Cookies } from "react-cookie-consent";

function App() {
return (
<Router>
  <Navbar />
  <Switch>
    <Route path='/' exact component={Home} />
    <Route path='/services' component={Services} />
    <Route path='/products' component={Products} />
    <Route path='/contattaci' component={Contattaci} />
    <Route path='/terms' component={Terms} />
    <div></div>
  </Switch>
  <CookieConsent>Questo sito web usa i cookie per migliorare l'esperienza dell'utente. 
  </CookieConsent>
  <Footer />
</Router>
 );
 }
 export default App;

然后我创建了一个app.css

 *{
   box-sizing: border-box;
   margin: 0;
   padding: 0;
   font-family: 'PT Sans', sans-serif;
   }

其余是连接到主文件的其他文件