I’m using this code to print out blogs on my site
<code><div class="blogView">
<ol>
<% if (locals.listaBlogova) { %>
<% listaBlogova.forEach(function (blog) { %>
<li class="blog-item"><h1><%= blog.naslov %></h1><br>
<h3>Autor: <%= blog.autor %></h3><br>
<p><%= blog.tekst %></p></li>
<form action="/edit/<%= blog.id %>" method="get"> <input type="submit" value="EDIT" id=<% blog.id %>></form>
<form action="/delete/<%= blog.id %>" method="get"> <input type="submit" value="DELETE" id=<% blog.id %>></form>
<% }); %>
<% }; %>
</ol>
</div>
</code>
<code><div class="blogView">
<ol>
<% if (locals.listaBlogova) { %>
<% listaBlogova.forEach(function (blog) { %>
<li class="blog-item"><h1><%= blog.naslov %></h1><br>
<h3>Autor: <%= blog.autor %></h3><br>
<p><%= blog.tekst %></p></li>
<form action="/edit/<%= blog.id %>" method="get"> <input type="submit" value="EDIT" id=<% blog.id %>></form>
<form action="/delete/<%= blog.id %>" method="get"> <input type="submit" value="DELETE" id=<% blog.id %>></form>
<% }); %>
<% }; %>
</ol>
</div>
</code>
<div class="blogView">
<ol>
<% if (locals.listaBlogova) { %>
<% listaBlogova.forEach(function (blog) { %>
<li class="blog-item"><h1><%= blog.naslov %></h1><br>
<h3>Autor: <%= blog.autor %></h3><br>
<p><%= blog.tekst %></p></li>
<form action="/edit/<%= blog.id %>" method="get"> <input type="submit" value="EDIT" id=<% blog.id %>></form>
<form action="/delete/<%= blog.id %>" method="get"> <input type="submit" value="DELETE" id=<% blog.id %>></form>
<% }); %>
<% }; %>
</ol>
</div>
I want to have 3 blogs in a row, but I can’t get them to go in rows they always go in the first column underneath one another, i think the problem is the way I print them idk, could use some help.
I have tried using both grid and flex, nothing seems to work, so maybe its the problem in the way im priting them out.
New contributor
Dusan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.