Reputation: 1
how can I put text beside picture without disturbing the other content?
this is a header
<div>
<img src="logo.ico" width="300px" height="200px" alt="logo"/>
<h1 class="header">Movies19</h1>
</div>
Upvotes: 0
Views: 53
Reputation: 962
you can add the two elements in the div to display:inline-block
tag
.line>* {
display: inline-block;
}
h1 {
vertical-align: middle;
height: 200px;
margin: 0;
}
<div class="line">
<img src="http://placehold.it/300x200" width="300px" height="200px" alt="logo" />
<h1 class="header">Mo</h1>
</div>
Upvotes: 1
Reputation: 159
<div>
<table>
<tr>
<td>
<img src="logo.ico" width="300px" height="200px" alt="logo" />
</td>
<td>
<h1 class="header">Movies19</h1>
</td>
</tr>
</table>
</div>
Upvotes: 0
Reputation: 4043
Use this
<style type="text/css">
img {
display: inline-block;
}
</style>
look at this link it may help more: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_img_default_css
Upvotes: 0