Reputation: 7618
I am trying to move this ul below a div, I am not even sure if this is the perfect way to do it as well,
Here is the code,
HTML
<div class="first">
<div id="Pic">
<img src="http://48jwh53mcwj217jvx11dcwjj.wpengine.netdna-cdn.com/wp-content/uploads/2013/07/avatar-2.jpg">
</div>
<div id="Name" class="left"> <span>User 1</span>
</div>
<div id="contactDetails" class="left">
<ul style="float: left;">
<li>
<img src="https://tutorials.hostmonster.com/help_media/email.png"><span id="Email">[email protected]</span>
</li>
<li>
<img src="https://tutorials.hostmonster.com/help_media/email.png"><span id="PhoneNumber">000000</span>
</li>
</ul>
</div>
<div style="clear: both;"></div>
</div>
CSS
#Pic img {
width: 128.5px;
height: 128px;
/* padding: 10px 7px 10px 7px; */
float: left;
border: 1px solid lightgrey;
margin-top: 4px;
margin-right: 5px;
}
#Name {
font-family:"Segoe UI Light", "Segoe UI", "Segoe", Tahoma, Helvetica, Arial, sans-serif;
font-size: 2.3em;
color: #777;
font-weight: 200;
}
.left {
float:left;
}
Fiddle
http://jsfiddle.net/fc2oya05/1/
What I want it to look like
Upvotes: 1
Views: 827
Reputation: 8271
CSS
.UIClass{
float: left;
padding-left: 0px;
padding-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px;
margin-top: 0px;
}
Here is My Demo
Upvotes: 1
Reputation: 3429
You can check with the below link.
#Email
{
margin-left:10px;
}
#PhoneNumber
{
margin-left:10px;
}
Upvotes: 1
Reputation: 826
You can check with the below link. You just have to remove float: left.
.left{
margin-left:13%;
}
Upvotes: 1
Reputation: 234
wrap name and details in one div <div class="userDetails"></div>
and remove class left
to some elements. Updated fiddle
Upvotes: 1
Reputation: 552
Take a look at your updated fiddle
You need to remove the float from your div,
.left{
/* float:left; */
}
And you should replace the float in your ul with the following to remove the bullets in your list
<ul style="list-style-type: none;">
Upvotes: 3
Reputation: 2157
<div id="Name" class="left">
remove class form name id
<div id="Name">
Upvotes: 1
Reputation: 24276
Wrap Name and ContactDetails to another div having class left
:
HTML:
<div class="first">
<div id="Pic">
<img src="http://48jwh53mcwj217jvx11dcwjj.wpengine.netdna-cdn.com/wp-content/uploads/2013/07/avatar-2.jpg">
</div>
<div class="left">
<div id="Name"> <span>User 1</span></div>
<div id="contactDetails">
<ul>
<li>
<img src="https://tutorials.hostmonster.com/help_media/email.png" class="left"><span id="Email">[email protected]</span>
</li>
<li>
<img src="https://tutorials.hostmonster.com/help_media/email.png" class="left"><span id="PhoneNumber">000000</span>
</li>
</ul>
</div>
</div>
<div style="clear: both;"></div>
</div>
CSS:
#Pic img {
width: 128.5px;
height: 128px;
/* padding: 10px 7px 10px 7px; */
float: left;
border: 1px solid lightgrey;
margin-top: 4px;
margin-right: 5px;
}
#Name {
font-family: "Segoe UI Light","Segoe UI","Segoe",Tahoma,Helvetica,Arial,sans-serif;
font-size: 2.3em;
color: #777;
font-weight: 200;
}
#contactDetails ul {
margin: 0;
padding: 0;
list-style:none;
}
#contactDetails ul li img {
margin-right: 5px;
}
.left{
float:left;
}
Upvotes: 2