首页 > 解决方案 > Reactjs 创建边框,而纯 html 没有

问题描述

我的问题是,当我在 js React 文件上使用此代码时,我基本上得到了两个侧边栏,无论我做什么,我都无法弄清楚如何删除它们,在 css 中,两侧没有边框/填充.

class App extends React.Component{
  render(){
    return(
      <div className="container-fluid">

        <div className="container-fluid home-div">
         <img className="profile-pic" src="https://www.ladyblitz.it/wp-content/uploads/2015/09/fbShared-e1442238915211.jpg"/>
          <h1 className="title">Title</h1>
          <h1 className="title-js">subtitle</h1>
        </div>

        <div className="container-fluid biography-div">
          <h1 className="biography-title">-- title thing --</h1>
          <p className="biography-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
        </div>
        
      </div>
    );
  }
}

ReactDOM.render(<App/>, document.getElementById('root'))

但是如果我把 html 写在 html 文件中,一切正常,我可以使用页面的整个宽度,没有侧边栏,谁能解释我为什么?

标签: javascripthtmlcssreactjs

解决方案


推荐阅读