更改Bootstrap锚元素的颜色

时间:2017-08-02 05:22:55

标签: html css twitter-bootstrap override

我无法更改Bootstrap设置为蓝色的锚元素的颜色。我试过这个:

#about{
  color:white !important;
}

而且:

body div#more a#about{
  color:white;
}

HTML:

   <div class="intro">
      <header class="header">
        <h1 class="my-name">Joe Schmo</h1>
        <div class="webdev">
          <span>&#123;   Web Developer </span><span>| St. Louis &#125;  
          </span>
        </div>
      </header>
      <div class="more" id="more">
        <a class="aboutme" id="#about" href="#about">About me</a>
        <a class="arrow fa fa-arrow-down" href="#about"></a>
      </div>
   </div>

1 个答案:

答案 0 :(得分:0)

您可以使用解决方案https://jsfiddle.net/dgcxd3gy/

.aboutme {
  color: rgba(255,0,0,0.5);
}

.aboutme:hover{
  color: rgba(255,0,0,1);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
 <div class="intro">
      <header class="header">
        <h1 class="my-name">Joe Schmo</h1>
        <div class="webdev">
          <span>&#123;   Web Developer </span><span>| St. Louis &#125;  
          </span>
        </div>
      </header>
      <div class="more" id="more">
        <a class="aboutme" id="#about" href="#about">About me</a>
        <a class="arrow fa fa-arrow-down" href="#about"></a>
      </div>
   </div>

定位 id 的元素。我使用过

即使您可以通过

定位元素
a[herf="#about"] {
   color: red;
}