Issue
Each div contains a list of varying lengths and because I'm using inline-block. I think it's causing it to align along the bottom of the div
with the most height.
Is there a way I can align these div
along the top or will I need to give each div
a unique id
and style
them each accordingly?
I made a fiddle here: http://jsfiddle.net/Bezzzo/dcqmh2g2/1/
HTML
<!-- footer -->
<div id="footer" >
<!--Community div-->
<div>
<h3>Community</h3>
<ul>
<li>Facebook</li>
<li>Twitter</li>
<li>Tumbler</li>
<li>Google plus</li>
</ul>
</div>
<!--Contact support div-->
<div>
<h3>Contact support</h3>
<ul>
<li>support@supportsupport.com.au</li>
</ul>
</div>
<!--Legal div-->
<div>
<h3>Legal</h3>
<ul>
<li>Terms and conditions</li>
<li>Refund policy</li>
<li>Privacy Policy</li>
</ul>
</div>
</div>
CSS
#footer {
position: relative;
width:1033px;
height: 160px;
margin:auto;
border-style:dashed;
}
#footer div {
display:inline-block;
position: relative;
margin-left: 150px;
border-style:dashed;
}
#footer ul {
list-style-type: none;
padding:0px;
margin:0px;
left:0px;
right:0px;
}
Thank you
Solution
Just add vertical-align: top;
to your #footer div
:
#footer div {
border-style: dashed;
display: inline-block;
margin-left: 150px;
position: relative;
vertical-align: top;
}
JsFiddle: http://jsfiddle.net/ghorg12110/dcqmh2g2/3/
Answered By - Magicprog.fr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.