Reputation: 1062
I need help doing something that seems very easy (as stated in some SO topics) but is not working for me. I need to position some images and text the same way as the example below:
_______________
| |
|IMG IMG |
| IMG | <h4>Big text here</h4>
| IMG | Simple <h5> text here, saying
| IMG | more about the image on side.
|_________IMG__|
The code I tried came from SO also, and is:
.img{
float: left;
margin-right:1rem;
}
.ban2 {
font-size: 23px;
}
<div>
<img class="img" width="500" src="img/Final-IMG.png">
<p>
<h3>Responsivo</h3>
<br>
<h5 class="light">Isso normalmente deveria ser correto</h5>
</p>
</div>
The text acts like it was a break with no margin on the left side, not in the right side of the image as it should. Can anyone help me achieving the result I want to? Thanks!
Upvotes: 0
Views: 45
Reputation: 1053
I think this is what you wanted?
.img{
float: left;
margin-right:1rem;
}
h3 {
color:red;
}
h5 {
color:green;
}
Link
http://codepen.io/damianocel/pen/zNwjyz
Or do you want the h3 and h5 to be under the img?
Upvotes: 0
Reputation: 12400
There's a few issues here:
.img{
float: left;
margin-right:1rem;
}
.ban2 {
font-size: 23px;
}
<div>
<img class="img" width="300" src="http://lorempixel.com/output/cats-q-c-300-300-3.jpg">
<p>
<strong>Responsivo</strong>
<br>
<strong class="light">Isso normalmente deveria ser correto</strong>
</p>
</div>
Upvotes: 1