jmona789 jmona789 - 1 month ago 17
CSS Question

Bootstrap slider is not visable

I am trying to use this bootstrap slider on a site I'm developing and its not displaying at all: http://seiyria.com/bootstrap-slider/
I created a plunker here to demonstrate the issue: https://plnkr.co/edit/msKlM1wYmm7QIiksuuQb Anyone know how to fix this?

html



<head>
<link rel="stylesheet" href="style.css">
</head>

<body>
<h1>Hello Plunker!</h1>
<input id="ex1" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="14"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.2.0/bootstrap-slider.js"></script>
<script src="script.js"></script>
</body>
</html>


css

#ex1Slider .slider-selection {
background: #BABABA;
}


js

var slider = new Slider('#ex1', {
formatter: function(value) {
return 'Current value: ' + value;
}
});

Answer

You also need the stylesheet that comes with the package. Add this to your head tag:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.2.0/css/bootstrap-slider.css" />