Folder and image address with bootstrap Carousel

Asked

Viewed 490 times

-2

How I modify this DIV to accept a folder and image name?

**<div class="fill" style="background-image:url('http://placehold.it/1900x1080&text=Slide Three');"></div>**

Switch to 'folder/filename.jpg' and do not load image.

Look at some of the code I’m trying to get the images to read. They are in a folder called at the same level as the index.htm file called fCapa, and all images are automatically renamed to have a sequence, so (1). jpg, (2). jpg, and so on, but.... do not load on canvas.`

      <!-- Wrapper for Slides -->
<div class="carousel-inner">
    <div class="item active">
            <div class="fill" style="background-image:url('fCapa/(1).jpg');">
        </div>  
            <div class="carousel-caption"><h2>Caption 1</h2>
            </div>
            </div>

            <div class="item">
                <div class="fill" style="background-image:url('fCapa/(2).jpg');">
        </div>
                    <div class="carousel-caption"><h2>Caption 2</h2>
                    </div>
            </div>

    <div class="item">
        <div class="fill" style="background-image:url('fCapa/(3).jpg');">
            </div>
            <div class="carousel-caption"><h2>Caption 3</h2>
            </div>
            </div>
</div>

<!-- Controls -->
  • 2

    Welcome to Stack Overflow, damn it! I suggest that you always include snippets of your code (or whole, if not so long), because it often makes it easier for other users to understand your problem and find a solution. Read at that link what I’m talking about!

  • It could be any number of things. In order to help, please [Edit] the question and indicate your folder structure, where is the file that contains that div, and where is the image.

  • Gentlemen, you cannot explain more clearly. Look: The source code clicks on a DIV an image of an http server, how do I switch to opening an image in a local folder? So I can go up to click on a suitable folder in the publication of the site. There is no simpler way to explain.

1 answer

0

Friend if it’s to make one Carousel, you can’t call the image on div through the CSS, try to do so:

<div class="carousel-inner" role="listbox">
  <div class="item active">
    <img src="fCapa/(1).jpg" alt="Imagem 1">
    <div class="carousel-caption">
      <!--Aqui vai a descrição da imagem-->
    </div>
  </div>
  <div class="item">
    <img src="fCapa/(2).jpg" alt="Imagem 2">
    <div class="carousel-caption">
      <!--Aqui vai a descrição da imagem-->
    </div>
  </div>
</div>

I believe you have the control part of Carousel, if not, follow the reference link: Bootstrap Carousel

Browser other questions tagged

You are not signed in. Login or sign up in order to post.