我知道这个网站上有很多关于全宽度引导带旋转木马的问题,但是我很困惑如何做? ,我花了一整天的时间来做到这一点,但我不能...
我给所有标签留出空白和填充0px和宽度100%,但它不起作用:/

Site.css

body {
padding-top: 0px;
padding-bottom: 0px;
}

.body-content {
padding-left: 0px;
padding-right: 0px;
}
input,
select,
textarea {
max-width: 280px;
}

.field-validation-error {
color: #b94a48;
}

.field-validation-valid {
display: none;
}

input.input-validation-error {
border: 1px solid #b94a48;
}

input[type="checkbox"].input-validation-error {
border: 0 none;
}

.validation-summary-errors {
color: #b94a48;
}

.validation-summary-valid {
display: none;
}


Index.cshtml

@model NP1.ViewModels.HomeVM
@{
ViewBag.Title = "Home Page";
}
@section scripts{

}
@section styles{

}
<!-- start carousel -->

<div class="carousel slide" data-ride="carousel" data-interval="3000">
<div  class="carousel-inner">
    @foreach (var item in Model.Carousels)
    {

        if (item == Model.Carousels.FirstOrDefault())
        {
            <div  class="item active ">
                <img style="height:450px; width:100%;" class="img-responsive" src="@Url.Content(item.CarouselImage.ToString())">
                <div class="carousel-caption">
                    <h3>@item.CarouselSubject</h3>
                    <h4>@item.CarouselInfo</h4>
                </div>
            </div>
        }
        else
        {
            <div  class="item">
                <img style="height: 450px; width: 100%;" class="img-responsive" src="@Url.Content(item.CarouselImage.ToString())" />
                <div class="carousel-caption">
                    <h3>@item.CarouselSubject</h3>
                    <h4>@item.CarouselInfo</h4>
                </div>
            </div>
        }
    }
</div>






Layout.cshtml:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@RenderSection("styles", false)
</head>
<body class="container-fluid" style="width:100% !important;padding:0px;">
@*overflow-x:hidden;*@

<div class="container body-content">
@RenderBody()
<footer></footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", false)
</body>
</html>

最佳答案

尝试这个

<div id="theCarousel" class="carousel slide" data-ride="carousel">
                    <ol class="carousel-indicators">
                        <li data-target="#theCarousel" data-slide-to="0" class="active"></li>
                        <li data-target="#theCarousel" data-slide-to="1"></li>
                        <li data-target="#theCarousel" data-slide-to="2"></li>
                    </ol>

                    <div class="carousel-inner">
                        <div class="item active">
                        <div class="slide1"></div>
                            <div class="carousel-caption">
                                <h1>Amazing Background</h1>
                            </div>
                        </div>
                        <div class="item">
                        <div class="slide2"></div>
                            <div class="carousel-caption">

                            </div>
                        </div>
                        <div class="item">
                        <div class="slide3"></div>
                            <div class="carousel-caption">

                            </div>
                        </div>
                    </div>
                </div>

09-26 01:49