I've been working on structuring a webpage with multiple divs containing images in a grid layout, but not using CSS Grid. Here's an example of what I'm trying to achieve:
<div class="some classes"> Some Text </div> <br>
<a href="somwhere"&gr;
<div class="some classes float-left">
<img src="http://someimage" height="200px" alt="An image"/> <br>
<div class="some other classes"> some image text </div>
</div>
</a>
... (repeated div links)
<footer> some footer </footer>
Using CSS
.float-left {
float:left;
}
The CSS classes are just placeholders without any specific meaning. The challenge lies in creating a layout where an unknown number of divs are generated automatically based on variable parameters. I initially used float:left
, but when I added a footer it caused alignment issues. This could be due to the use of float property. I'm looking for an alternative approach that is responsive and does not rely on JavaScript. Any suggestions?