MDB Bootstrap无法正常运行

时间:2017-10-25 10:30:28

标签: html css html5 twitter-bootstrap model-view-controller

我使用默认布局和另一个扩展它的模板。我正在尝试使用mdb bootstrap免费版本,但它没有正常运行。我认为在head-layouts文件中链接有问题。我也试过在当地安装,但也没有工作。也许我错过了一些基本的东西。

布局:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>dataMS</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.1/css/mdb.min.css" rel="stylesheet"/>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="styles/site.css" rel="stylesheet"/>
</head>

模板扩展布局 -

<div id="carousel-example-2" class="carousel slide carousel-fade" data-ride="carousel">
<!--Indicators-->
<ol class="carousel-indicators">
    <li data-target="#carousel-example-2" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-2" data-slide-to="1"></li>
    <li data-target="#carousel-example-2" data-slide-to="2"></li>
</ol>
<!--/.Indicators-->
<!--Slides-->
<div class="carousel-inner" role="listbox">
    <div class="carousel-item active">
        <div class="view hm-black-light">
            <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(68).jpg" alt="First slide">
            <div class="mask"></div>
        </div>
        <div class="carousel-caption">
            <h3 class="h3-responsive">Light mask</h3>
            <p>First text</p>
        </div>
    </div>
    <div class="carousel-item">
        <!--Mask color-->
        <div class="view hm-black-strong">
            <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).jpg" alt="Second slide">
            <div class="mask"></div>
        </div>
        <div class="carousel-caption">
            <h3 class="h3-responsive">Strong mask</h3>
            <p>Secondary text</p>
        </div>
    </div>
    <div class="carousel-item">
        <!--Mask color-->
        <div class="view hm-black-slight">
            <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).jpg" alt="Third slide">
            <div class="mask"></div>
        </div>
        <div class="carousel-caption">
            <h3 class="h3-responsive">Slight mask</h3>
            <p>Third text</p>
        </div>
    </div>
</div>
<!--/.Slides-->
<!--Controls-->
<a class="carousel-control-prev" href="#carousel-example-2" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel-example-2" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
</a>
<!--/.Controls-->

1 个答案:

答案 0 :(得分:1)

您正在使用Bootstrap 3,而MDB基于Bootstrap 4.B4不向后兼容Bootstrap 3,因此它不起作用。从这里下载新包装: https://mdbootstrap.com/getting-started/

放置您的代码,它将起作用。我刚试过它。