Issue
I would like to achieve the following placement:
Two different texts (in block) floating / inline next to image. (Everything inside div).
I have been trying with different display settings (block + inline for text etc.) but it is still not working.
HTML:
<div class="res">
<img src="<?php echo 'img/'.$row["sType"].'.png';?>"/>
<span>TITLEe</span>
<span>Description</span>
</div>
CSS:
.res {
height:60px;
background-color:yellow;
border-bottom:1px solid black;
text-align:left;
}
.res img {
margin-top:8.5px;
margin-left:5px;
display:inline
}
.res span {
display:block;
}
Solution
.content {
width: 400px;
border: 4px solid red;
padding: 20px;
overflow: hidden;
}
.content img {
margin-right: 15px;
float: left;
}
.content h3,
.content p{
margin-left: 15px;
display: block;
margin: 2px 0 0 0;
}
<div class="content">
<img src="http://cdn4.iconfinder.com/data/icons/socialmediaicons_v120/48/google.png"/ alt="" >
<h3>Title</h3>
<p>Some Description</p>
</div>
Answered By - Ahsan Khurshid
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.