You can add display: block
to the image (since soon after <hr>
comes) and also I do not see the need for position: absolute
, something like:
.container img {
display: block;
}
.container hr {
width: 250px;
height: 3px;
border-width: 0;
background-color: #d29e1d;
margin: 0 0 10px 0;
}
<div class="container">
<img src="http://culturalis.pt/wp-content/uploads/2015/06/curva.png"alt="curva"/>
<hr/>
</div>
Or with border
(without <hr>
):
.container img {
display: block;
}
.container {
width: 250px;
border-bottom: 3px #d29e1d solid;
margin: 0 0 10px 0;
}
<div class="container">
<img src="http://culturalis.pt/wp-content/uploads/2015/06/curva.png"alt="curva"/>
</div>
If you want to add content to the right side of the image you can use background: ...;
combined with margin
or padding
:
.container h1 {
margin: 0 0 0 30px;
}
.container {
width: 250px;
border-bottom: 3px #d29e1d solid;
margin: 0 0 10px 0;
background: url(
http://culturalis.pt/wp-content/uploads/2015/06/curva.png) bottom left no-repeat;
}
<div class="container">
<h1>Test</h1>
</div>
Example text to the right:
.container h1 {
width: 100px;
margin: 0;
float: left;
}
.sub-container {
float: left;
width: 250px;
border-bottom: 3px #d29e1d solid;
margin: 0 0 10px 0;
display: inline-block;
}
.sub-container img {
display: block;
}
<div class="container">
<h1>Texto</h1>
<div class="sub-container">
<img src="http://culturalis.pt/wp-content/uploads/2015/06/curva.png"alt="curva"/>
</div>
</div>
I recommend studying the basics of CSS (like float
and display
) recommend the following links:
link
link
link
link (Maujor from CSS in Portuguese :))