Bootstrap类容器不起作用

时间:2017-08-26 09:47:03

标签: html css twitter-bootstrap

我正在ASP MVC上开发一些网站。我使用Visual Studio 2017.我已经从NUGET包中安装了bootstrap插件。但是以下代码不起作用。我的意思是类容器不会添加边距。为什么这样?我做错了什么?我添加的脚本,嵌入了disqus评论系统。

<div class="container text-center">
   <div class="row">
      <div class="col-md-8">
         <h2>@Model.Title</h2>
         <p>@Html.Raw(Model.Content)</p>
         <div id="disqus_thread"></div>
         <script>
(function () { // DON'T EDIT BELOW THIS LINE
   var d = document, s = d.createElement('script');
   s.src = 'https://incredibleenglish.disqus.com/embed.js';
   s.setAttribute('data-timestamp', +new Date());
   (d.head || d.body).appendChild(s);
})();
         </script>
         <noscript>Please enable JavaScript to view the <a 
            href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
     </div>
  </div>
   </div>

1 个答案:

答案 0 :(得分:0)

它有效,我认为它与你的引导程序安装有关

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

<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>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<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>


<div class="container text-center">
        <div class="row">
            <div class="col-md-8">
                <h2>@Model.Title</h2>
                <p>@Html.Raw(Model.Content)</p>
                <div id="disqus_thread"></div>
                <script>
                    (function () { // DON'T EDIT BELOW THIS LINE
                        var d = document, s = d.createElement('script');
                        s.src = 'https://incredibleenglish.disqus.com/embed.js';
                        s.setAttribute('data-timestamp', +new Date());
                        (d.head || d.body).appendChild(s);
                    })();
                </script>
                <noscript>Please enable JavaScript to view the <a 
                 href="https://disqus.com/?ref_noscript">comments powered by 
                 Disqus.</a></noscript>
            </div>
        </div>
    </div>