Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,

I try to make a full slider of two images. the slider is working, but the images are not fullsize. This is what I have:

index.cshtml:

C#
<pre lang="xml">@section Styles {
    <link href="@Url.Content("~/Content/the-big-picture.css")" rel="stylesheet" type="text/css" />
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Example of Bootstrap 3 Carousel</title>

</head>
<body>
    <div class="bs-example">
        <div id="myCarousel" class="carousel slide" @*data-interval="1000"*@ data-ride="carousel">
            <!-- Carousel indicators -->
            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>

            </ol>
            <!-- Carousel items -->
            <div class="carousel-inner">
                <div class="active item">

                    <div class="item">
                        <div class="fill" style="background-image:url('../../Images/VeryLarge.JPG');">
                            @*<div class="container">

                            </div>*@
                        </div>
                    </div>

                </div>
                <div class="item">
                    <div class="fill" style="background-image:url('../../Images/road.JPG');">
                        <div class="container">

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

            </div>
            <!-- Carousel nav -->
            <a class="carousel-control left" href="#myCarousel" data-slide="prev">
                @*<span class="glyphicon glyphicon-chevron-left"></span>*@
            </a>
            <a class="carousel-control right" href="#myCarousel" data-slide="next">
                @*<span class="glyphicon glyphicon-chevron-right"></span>*@
            </a>
        </div>
    </div>
</body>
</html>

@section Scripts
{

@*<link href="@Url.Content("~/Content/bootstrap-theme.min.css")" rel="stylesheet" type="text/css" />*@
@*<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />*@
<link href="@Url.Content("~/Content/Cyborg-bootstrap.min.css")" rel="stylesheet" type="text/css" />

<script src="@Url.Content("~/Scripts/jquery-1.11.0.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>

    }





and my css:



CSS
.item {
            /*background: #333;*/
            text-align: center;
            height: 1000px !important;
            /*width:1900px !important;*/
        }

        /*.carousel {
            margin-top: 20px;
        }*/

@media (max-width: 767px) {
    body {
        width:auto;
        padding-left: 0;
        padding-right: 0;
        background-size: cover;
        background-color: black;
    }
}

    .full {
        /*background: url(../Images/VeryLarge.JPG) no-repeat center center fixed;*/

        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }

    .bs-example {
        margin: 20px;
        background-size: cover;
    }


    .carou
Posted
Updated 18-Mar-15 18:21pm
v2

Hi,

Please try like this. Use img control to display the images. Please let me know if this helps your problem.

XML
<div class="carousel-inner">
               <div class="active item">

                   <div class="item">
                       <div class="fill">
                           <div class="container">
                               <img src="Images/3.jpg" />
                           </div>
                       </div>
                   </div>

               </div>
               <div class="item">
                   <div class="fill">

                       <div class="container">
                           <img src="Images/2-small.jpg" />
                       </div>
                   </div>
               </div>

           </div>
 
Share this answer
 
Comments
[no name] 10-Mar-15 2:55am    
Thank you for your answare, I found the solution, see my post
King Fisher 19-Mar-15 3:54am    
If you got the Solution then Post your Answer and Accept it .so your question will we moved from UnAnswered Queue. And your answer may help others or for your Future Reference.
XML
<section class="block">
    <div id="myCarousel" class="carousel slide">
        <div class="carousel-inner">
            <div class="active item">
                <img src="" alt="Slide1" />
            </div>
            <div class="item">
                <img src="" alt="Slide2" />
            </div>
            <div class="item">
                <img src="" alt="Slide3" />
            </div>
        </div>
        <a class="carousel-control left" href="#myCarousel" data-slide="prev"></a>
        <a class="carousel-control right" href="#myCarousel" data-slide="next"></a>
    </div>
</section>
 
Share this answer
 
I realy don' t understand what happened here. But I posted already three times my solution here. Anyway thank you all for the answares

I do it again:

This is my solution:

XML
<div class="bs-example" style="position:fixed;width:100%;height:100%;z-index:-1;top:0;left:0;">

      <div id="myCarousel" class="carousel slide" @*data-interval="1000"*@ data-ride="carousel">
          <!-- Carousel indicators -->
          <ol class="carousel-indicators">
              <li data-target="#myCarousel" data-slide-to="0"></li>
              <li data-target="#myCarousel" data-slide-to="1"></li>

          </ol>

          <!-- Carousel items -->
          <div class="carousel-inner">
              <div class="active item">

                  <div class="item">


                      <div class="fill" style="background-image:url('../../Images/road.JPG');">
                          @*<div class="container">

          </div>*@
                      </div>
                  </div>

              </div>
              <div class="item">
                  <div class="fill" style="background-image:url('../../Images/VeryLarge.JPG');">

                          <div class="container">

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

          </div>
          <!-- Carousel nav -->
          <a class="carousel-control left" href="#myCarousel" data-slide="prev">
              @*<span class="glyphicon glyphicon-chevron-left"></span>*@
          </a>
          <a class="carousel-control right" href="#myCarousel" data-slide="next">
              @*<span class="glyphicon glyphicon-chevron-right"></span>*@
          </a>
      </div>
  </div>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900