Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twitter bootstrap carousel size

Tags:

I'm creating a website for my dad using Twitter Bootstrap, it's done except for one thing: I can't figure out how to:
- reduce the carousel width
- center the carousel
- make scroll arrows still on image

here is the website so you can check the source

I've literally gone line by line through the css and adjusted every aspect of the carousel and then checked it in my browser.

Another point of confusion is that some of these adjustments have an effect if i test it in my browser with SHIFT+CTRL+R (so notepad++ opens it in google chrome directly from my desktop w/o using a server or host) and have seen some awkward changes, yet none of these changes carry over when I place them on the server.

I've seen some other posts suggesting adjustments to .carousel and @image and have tried those without success as well.

like image 932
user2016949 Avatar asked Jan 29 '13 19:01

user2016949


People also ask

What size should bootstrap carousel images be?

If you want to have a carousel image that spans the full width of the screen its probably a good idea to use an image that is at least 1024 px wide (possibly wider), though you don't want it to be too high resolution, since that would take a long time to load.

How do I change the height of a bootstrap carousel?

It would simply be called with: $("#slider . carousel-inner"). normalizeHeight(); $(window).


2 Answers

You can just set the width of the carousel using CSS. Centering a block element is done with margin: 0 auto. Only change the CSS of .carousel, the rest is automatically styled correctly.

<div id="myCarousel" class="carousel slide" style="width: 400px; margin: 0 auto">     ... </div> 

Check out this jsfiddle to see it work.

like image 175
Arnold Daniels Avatar answered Sep 17 '22 12:09

Arnold Daniels


Simply add a class of 'container' onto the DIV with an ID of 'myCarousel'.

So this...

<div id="myCarousel" class="carousel slide"> 

Becomes...

<div id="myCarousel" class="carousel slide container"> 
like image 21
Billy Moat Avatar answered Sep 19 '22 12:09

Billy Moat