Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't Center Group of images (Class images) side-by-side in CSS
    primarykey
    data
    text
    <p>I've already tried some things, but haven't had any luck.</p> <p>I have a class that scrolls an image upwards in my CSS. I want to be able to create 3 of these images in a row and center them, However since they are float left they cant be centered. If i change it to float center the image will stack on top of each other rather than side by side. Margin left/right auto doesn't seem to work either. I'm not sure what to do</p> <p>My CSS Code:</p> <pre><code>.pic { border: 3px solid#fafafa; float: left; height: 250px; width: 300px; margin: 20; overflow: hidden; } .aligncenter {text-align:center} /*VERTPAN*/ .vertpan img { display: block; margin-left: auto; margin-right:auto; margin-top: 0px; text-align: center; -webkit-transition: margin 1s ease; -moz-transition: margin 1s ease; -o-transition: margin 1s ease; -ms-transition: margin 1s ease; transition: margin 1s ease; } .vertpan img:hover { margin-top: -250px; } </code></pre> <p>My HTML Code:</p> <pre><code>&lt;div class = "vertpan pic"&gt;&lt;img class="aligncenter" alt="climb" src="http://i.imgur.com/XIaOaId.jpg" /&gt;&lt;/div&gt; &lt;div class = "vertpan pic"&gt;&lt;img class="aligncenter" alt="climb" src="http://i.imgur.com/69K8qMU.jpg" /&gt;&lt;/div&gt; &lt;div class = "vertpan pic"&gt;&lt;img class="aligncenter" alt="climb" src="http://i.imgur.com/XIaOaId.jpg" /&gt;&lt;/div&gt; </code></pre> <p>I've tried centering in every way I know of but nothing has worked. I'm sure it's something simple, I just don't fully understand HTML or CSS as of right now that's the problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload