Side by Side Image Elements Using CSS

I am trying to display images side by side using only css. The problem is that the images are not displayed in the line but as a list (I use a tag to accomplish this). Maybe I'm using the wrong tag type, or my css is just wrong (see below):

ul {sail left; width: 15 microns; / * width changes * / margin: 0; filling: 0; list-style-type: none; list-style-position: external; } li {sail left; width: 100%; margin: 20%; }

I could use some help =)

+3
source share
3 answers

try the following:

ul.gallery {
   height:425px;
   width:200px;
   list-style-type: none;
}
ul.gallery li {
   border:1px solid #BBBBBB;
   float:right;
   height:50px;
   margin-right:7px;
   margin-top:7px;
   width:50px;
}

And (x) html

<ul class="gallery">
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li> 
    <li><img src="images/0001.jpg" /></li>
</ul>
+8
source

span, ul/li? , , , .

0

?

ul
 li  img 1 /li
 li  img 2 /li
/ul 

, css li

li { display:block float:left padding: 0 margin: 0} 
ul { padding:0 margin 0;}
0

Source: https://habr.com/ru/post/1708576/


All Articles