简体   繁体   中英

My bootstrap has conflicts with my css in React JS

When I put the bootstrap link in <head></head> my style change without any reason.

Without bootstrap link: 在此处输入图片说明

With boostrap link: 在此处输入图片说明

Here the style of the header:

.headerStyle {
  background-color: black;
  flex-direction: row;
  justify-content: space-between;
  display: flex;
}

Here the header in React JS:

 <div className="headerStyle" style={{ height: 60 }}>

    <div style={{ flexDirection: 'row', display: 'flex' }}>
      <ButtonSection name="Home" path="/" />
      <ButtonSection name="About" path="/about" />
      <ButtonSection name="Contact Us" path="/contactUs" />
    </div>

    <div style={{ justifyContent: 'space-evenly', display: 'flex', alignItems: 'center' }}>
      <SignUpButton />
      <LoginButton />
    </div>
  </div>

Try and add align-items: 'center' to .headerStyle

.headerStyle {
   background-color: black;
   flex-direction: row;
   justify-content: space-between;
   display: flex;
   align-items: 'center'
 }

所以问题是<p></p>标签,没有任何其他解决方案,如果你想写一个文本只使用<div></div>而不是<p></p>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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