0
I’m learning HTML and CSS and I’m making a site to practice and I’m having a doubt.
I want to put the title of the images next to each other.
"The best Cookie’s" on the side right of the corresponding image.
"The best coffee" on the side left of its corresponding image.
I was able to put the first text in the right place, but by adding the other one I simply can’t put the left side of the second image.
HTML below:
<body>
<header>
<div class="container">
<div id="logo">
<img src="logo.png">
</div>
</div>
</header>
<div class="container">
<div id="title1">
<h1> Os melhores Cookie's!</h1>
</div>
<div id="title2">
<h1> O melhor Café!</h1>
</div>
<div id="foto1">
<img src="cookie.jpg">
</div>
<div id="foto2">
<img src="cafe.jpg">
</div>
</div>
CSS BELOW
#container{
width: 1000px;
margin:0 auto;
}
#foto1{
width: 500px;
height: 500px;
}
#foto1 img{
max-width: 100%;
padding-top: 250px;
margin-left: 100px;
}
#foto2{
width: 500px;
height: 500px;
}
#foto2 img{
margin-left: 450px;
padding-top: 150px;
max-width: 100%;
}
#title1 {
text-align:center;
width: 370px;
max-height: 45px;
background-color: tan;
border-radius: 10px 20px;
font-family: Comic Sans MS;
margin-top: 265px;
float: right;
}
#title2 {
text-align:center;
width: 370px;
max-height: 45px;
background-color: tan;
border-radius: 10px 20px;
font-family: Comic Sans MS;
float: left;
}
Just a note, when you use the text as content vc could not select it with the mouse...
– hugocsl
But from what I understand in his code, he wants to assign LINK, and this achieves both with HTML5 and with Javascript or Jquery.
– Cesar Silveira