JavaScript Replacing HTML with JavaScript changed style, images no longer in-line horizontally replacing html with jquery,replacing html with javascript,replacing html

I'm new to coding and I replaced some repetitive HTML with JavaScript and now the images, which used to display 4 across, are no longer displaying horizontally. They now display on the left only. I've tried replacing float left in the child div with float left in the parent div, display: inline block, and display: inline. How can I get it to display 4 across again?

<section class= "gal">
<script src="./gallery.js"></script
      <!---<div class="img" id="picture">
          <img class="img-zoom" src="./images/ore1.png" alt="" width="300"     height="200">
          <div class="desc">Turquoise Nugget Earrings</div>
  </div>

  <div class="img">
      <img class="img-zoom" src="./images/ore9.png" alt="" width="300" height="200">
      <div class="desc">Black Cinnabar Earrings</div>
  </div>
  <div class="img">
      <img class="img-zoom" src="./images/ore11.png" alt="" width="300" height="200">
      <div class="desc">White Shell Earrings</div>
  </div>
  <div class="img">
      <img class="img-zoom" src="./images/ore12.png" alt="" width="300" height="200">
      <div class="desc">White Shell and Flower Charm Earrings</div>
  </div>
  <div class="img">
      <img class="img-zoom" src="./images/ore13.png" alt="" width="300" height="200">
      <div class="desc">Light Green Resin Earrings</div>
  </div>--->   

Here is the CSS:

section.gal {

}
div.img {
    margin: 15px;
    width: 300px;
    float: left;

}

div.img:hover {

}

div.img img {
    width: 100%;
    height: auto;
}

div.desc {
    padding: 15px;
    text-align: center;
}

.img-zoom {
    width: 500px;
    -webkit-transition: all .2s ease-in-out;
    -moz-transition: all .2s ease-in-out;
    -o-transition: all .2s ease-in-out;
    -ms-transition: all .2s ease-in-out;
}

.transition {
    -webkit-transform: scale(2); 
    -moz-transform: scale(2);
    -o-transform: scale(2);
    transform: scale(2);
}

And the Java Script:

    var galleryImages = [
['ore1', 'Turquoise Nugget Earrings'],
['ore9', 'Black Cinnabar Earrings'],
['ore11' 'White Shell Earrings'], 
['ore12', 'White Shell and Flower Charm Earrings']
];

function print(message) {
    var pictureDiv = document.getElementById ('picture');
    pictureDiv.innerHTML = message;
}

function displayImages(list) {
    var listHTML = '<div class="img">';
    for (var i = 0; i<list1.length; i +=1) {
        listHTML += '<img class="img-zoom" src="./images/' + list[i][0] + '.png" alt="" width="300" height="200">';
        listHTML += '<div class="desc">' + list[i][1] + '</div>';

    }
    listHTML += '</div>';
    print(listHTML);
}

displayImages (galleryImages);
Answer:1

How do I find vertices positions of a mesh after I used .fromGeometry(); code? I created a buffergeometry from a geomtery that I used for a mesh. Here is an example. var geom = new THREE.BoxGeometry(...

How do I find vertices positions of a mesh after I used .fromGeometry(); code? I created a buffergeometry from a geomtery that I used for a mesh. Here is an example. var geom = new THREE.BoxGeometry(...

Here is my input <input type="text" class="ChampionInput" list="champions" name="champion[]"`placeholder="Champion" required> And here is my js document.forms["first_form_champions"].oninput ...

Here is my input <input type="text" class="ChampionInput" list="champions" name="champion[]"`placeholder="Champion" required> And here is my js document.forms["first_form_champions"].oninput ...

  1. firefox displays html code instead of page

I'm sending cross-domain ajax request and on another end request.is_ajax() gives False var text = getSelectedText(); text = 'text'; if (text){ var xhttp = new XMLHttpRequest(); xhttp....

I'm sending cross-domain ajax request and on another end request.is_ajax() gives False var text = getSelectedText(); text = 'text'; if (text){ var xhttp = new XMLHttpRequest(); xhttp....

  1. django request is ajax
  2. django request.is_ajax() not working
  3. django request.is_ajax example
  4. django if request is ajax
  5. django check request is ajax
  6. django request ajax post
  7. django check if request is ajax
  8. django request.session ajax
  9. django check ajax
  10. django view check if request is ajax

I've been struggling to figure out why my If Else statement is returning incorrectly with any value after Par. I believe it's because my If Else is attempting to concatenate instead of add, but I can'...

I've been struggling to figure out why my If Else statement is returning incorrectly with any value after Par. I believe it's because my If Else is attempting to concatenate instead of add, but I can'...

  1. javascript adding numbers as strings
  2. javascript adding numbers in an array
  3. javascript adding numbers not working
  4. javascript adding numbers with decimals
  5. javascript adding numbers concatenates
  6. javascript adding numbers together
  7. javascript adding numbers
  8. javascript adding numbers from input
  9. javascript adding numbers nan
  10. javascript adding numbers in for loop
  11. javascript adding numbers wrong
  12. javascript adding numbers with commas
  13. javascript adding numbers to list
  14. javascript adding two numbers
  15. javascript not adding numbers
  16. javascript adding negative numbers
  17. javascript function adding numbers
  18. javascript adding large numbers
  19. javascript adding two numbers w3schools
  20. javascript adding big numbers