2017-04-25 79 views
0
<!DOCTYPE html> 
    <html lang="en"> 
    <head> 
     <meta charset="UTF-8"> 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     <meta name="author" content="Emily Thacker"> 
     <title>[Insert Name of Business Here]</title> 
     <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" 
     <link rel="stylesheet" type="text/css" href="large_css.css"> 
    </head> 
    <body> 
    <div class="container-fluid"> 

    <header class="page-header"> 
     <h3 class="text-center">[Insert Company Logo here]</h3> 
     <div class="btn-group btn-group-justified"> 
      <a class="btn navigation">Home</a> 
      <a class="btn navigation">About</a> 
      <div class="btn-group"> 
       <a class="btn dropdown-toggle navigation" data-toggle="dropdown"> 
        Services <span class="caret"></span></a> 
       <ul class="dropdown-menu" role="menu"> 
        <li><a href="#">Web</a></li> 
        <li><a href="#">Mobile</a></li> 
        <li><a href="#">App</a></li> 
       </ul> 
      </div> 
      <a class="btn navigation">Contact</a> 
     </div> 
    </header> 


    <section class=""> 
     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. 
    </section> 
    <section> 
     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. 
    </section> 

    <footer class="modal-footer"> 
     <li class="list-group-item-heading">list item</li> 
     </ul> 
     <address>Contact Information</address> 
    </footer> 
    </div> <!-- closing container --> 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
    </body> 
    </html> 

CSS工作外部CSS文件不与引导CSS

body > div > header > div > a.navigation { 
    background-color: darkgray; 
    color: white; 
} 

所以我想改变导航栏上的颜色(锚标记与BTN类)。我试过增加特异性,我的外部CSS的链接是在引导CDN之后,我清除了缓存,我用过!重要的。我似乎无法弄清楚我错过了什么。我对bootstrap完全陌生,并试图找出如何将其纳入我的网站。

+0

是否也能告诉我们您的自定义的CSS文件?你可以创建一个代码片段。 –

+0

现在只有三条线;它与HTML混在一起,我将它分开。 – ethacker

回答

4

你忘了关闭,其中包括引导标签:

<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 

添加最后>底。

+0

@ethacker,你有没有试过这个答案?这个答案没有工作吗? – manian

+1

@manian我刚刚做了,是的,它的工作。谢谢!我不能相信我错过了这一点。 (我只是复制并粘贴了一个网站的链接,我可能只是错过了最后一个>当我这样做时) – ethacker

1

开始使用IDE的&语法高亮功能的IDE。

这不是对你的问题的直接回答,但它将在未来节省大量的开发时间以避免这些类型的问题。

我希望你可以花费至少30分钟试图解决这个问题,并通过发布它。但是当我查看你的代码时,我立即发现了这个问题。这是因为SO代码块中的语法高亮功能。

我在职业生涯的初期阶段多次遇到这类问题&我花了大量时间试图解决问题&后来发现它只是一个错字错误或语法错误。然后我开始使用IDE,现在它为我节省了很多时间。

始终使用IDE并尝试使用IDE的功能。以下是使用IDE的一些优点。 https://stackoverflow.com/a/208221/4874281Why is debugging better in an IDE?

这里是IDE的,你可以从中进行选择的列表,https://www.g2crowd.com/categories/integrated-development-environment-ide

+1

我使用PHPstorm,并没有指出它(通常有一些红色的波浪形或什么)。谢谢! – ethacker

+0

哦,好的。 PHPstorm是一个非常棒的IDE,它有很多额外的插件来增强已经有资源的工具。 – manian