2017-09-16 122 views
-3

我是新來的光滑,反應,反應,光滑和我進行了使用react-slick一個新的組件。當我實現響應式輪播和CSS(甚至在此之前)時,元素會垂直堆疊,如您在this image中所看到的。任何幫助,將不勝感激。陣營油滑不工作

+0

請大家看看[問]和[MCVE] – bennygenel

+0

請上傳您的代碼,以使問題更加清晰。 –

回答

0

最好是添加你的代碼... 反正這裏是油滑做出反應的一個例子:

HTML:

<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script> 

<div id="container"> 
    <!-- This element's contents will be replaced with your component. --> 
</div> 

JS:

var ReactSlickDemo = React.createClass({ 
    render: function() { 
    var settings = { 
     dots: true 
    } 
    return (
     <div className='container'> 
     <Slider {...settings}> 
      <div><img src='http://placekitten.com/g/400/200' /></div> 
      <div><img src='http://placekitten.com/g/400/200' /></div> 
      <div><img src='http://placekitten.com/g/400/200' /></div> 
      <div><img src='http://placekitten.com/g/400/200' /></div> 
     </Slider> 
     </div> 
    ); 
    } 
}); 

ReactDOM.render(
    <ReactSlickDemo />, 
    document.getElementById('container') 
); 

CSS:

.container { 
    margin: 0 auto; 
    padding: 40px; 
    width: 80%; 
    color: #333; 
    background: #419be0; 
} 

here