1
Hello
I’m making a simple product page but I’m having some difficulties in positioning the elements as well as in the print below:
First I was using attributes like: Left: ?? px; bottom: ?? px; ,but it did not work very well, because the site was getting spaces where they were not like the print below:
Example of how I was doing:
<div class="3row">
<section>
<h2 class="TituloP1" style="position: relative; bottom: 2850px; left: 250px; font-size: 25px;">Kit Cirúrgico 20g para Implante</h2>
<img src="images/Rolete_de_Algodao.jpg" style="position: relative; border-style: solid; border-color: #BE1E2D; border-width: 1px; margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; width: 350px; bottom: 2930px; left: 100px;"
/>
</section>
<section>
</section>
<section>
<h2 class="precodPor" style="color: #BE1E2D;font-size: 25px; position: relative; bottom: 3020px; left: 305px;">R$25,84</h2>
</section>
<section>
<a href="Adesivo_Magic_Bond_Esmalte.html" class="button style1" style="position: relative; bottom: 3070px; left: 240px;">Ver detalhes</a>
</section>
</div>
Spaces that were too much:
Searching the internet I found this code that would position the elements using Ul and Li
CSS and HTML:
margin: 0;
/* removendo margin padrão */
padding: 0;
/* Removendo padding padrão */
text-align: center;
}
li {
display: inline-block;
width: 45%;
}
.left {
background-color: White;
}
.right {
background-color: White;
}
<ul class="produtos">
<li class="left half">
<h2 style="text-align: center; font-size: 25px;">Silicone de condesação Perfil</h2>
<img src="images/Silicone_de_Condensacao.jpg" style="border-style: solid; border-color: #BE1E2D; border-width: 1px; margin-top: 100px; margin-bottom: 100px; margin-right: 150px; margin-left: 80px; width: 350px;">
<h2 style=" text-decoration: line-through; color: gray;">R$179,99</h2>
<h2 class="precodPor" style="color: #BE1E2D;font-size: 25px;">R$166,00</h2>
<a href="Silicone_de_condesacao_Perfil.html" class="button style1" >Ver detalhes</a>
</li>
<li class="right half">
<h2 style="text-align: center; font-size: 25px;">Alginato Algi-Gel</h2>
<img src="images/Alginato-Gel_2.jpg" style="border-style: solid;
border-color: #BE1E2D;
border-width: 1px;
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px; width: 350px;">
<h2 class="precodPor" style="
color: #BE1E2D;
font-size: 25px;">R$12,50</h2>
<a href="Alginato_Algi-Gel.html" class="button style1">Ver detalhes</a>
</li>
</ul>
The result was getting like this, but I want to center the texts and buttons with the image:
What I could edit on the titles and button to position them the way I need?
You could use the bootstrap! I always use it because it saves a lot of development time and makes your site responsive!
– Pena Pintada
I’m still a basic programmer, what do you mean ?
– Luhan Salimena
Try to learn through video lessons on youtube search for bootstrap! This is the official website of bootstrap http://getbootstrap.com/components/
– Pena Pintada
I will certainly learn, but I need to finish this page of the site today, would help me to position the elements??
– Luhan Salimena
I made the code just for two images
– Pena Pintada