Jump to content

Recommended Posts

Hi

I am having some trouble with the positioning of my carousel and was wondering if anyone could give me some help

All my images are 900px wide which is the with of "wrapper-main"

I was under the impression as the carousel is within the div its position should be centralised.

i cannot get it centred at all. 

Below is the HTLM

Quote

<main>
  <link rel="stylesheet" type="text/css" href="style.css">
  <link rel="stylesheet" type="text/css" href="owl.Carousel.min.css">
  <link rel="stylesheet" type="text/css" href="owl.theme.default.min.css">

  <div class="wrapper-main">
     <section class="section-default">
          
          <?php
          if (!isset($_SESSION['id'])) {
            echo '<p class="login-status">You are currently logged out, please log in to continue.</p>';

          }
          else if (isset($_SESSION['id'])) {
            echo '<p class="login-status"></p>';
             header ('Location: Dashboard.php');
          }
          ?> 


      </section>
	
    <section class="section-default1">
      <div class="wrapper">
        <div class="owl-carousel owl-theme">
        <div class="item"><img src="banner-1t.jpg" alt="1"></div>
        <div class="item"><img src="banner-2t.jpg" alt="2"></div>
        <div class="item"><img src="banner-3t.jpg" alt="3"></div>
        <div class="item"><img src="banner-4t.jpg" alt="4"></div>
      </div>
    </section>  
 
  </div>

  <script type="text/javascript" src="jquery-3.15.1.js"></script>
  <script type="text/javascript" src="owl.carousel.min.js"></script>
  <script type="text/javascript" src="jquery.js"></script>


    </main>

 

below is the jquery.js i am using 

$('.owl-carousel').owlCarousel({
	autowidth:true,
	dots:false,
    loop:true,
    margin:10,
    nav:false,
    pagination:false,
    autoplay: 10,
    centre:true,
    responsive:{
        0:{
            items:2
        },
        600:{
            items:2
        },
        1000:{
            items:2
        }
    }
})

 

Could somebody help in getting this carousel centred in my page. Its not the images, they are fine. Its the actual carousel.

Thanks 

Link to comment
https://forums.phpfreaks.com/topic/311377-owl-carousel-positioning/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.