Jump to content

3 Divs Left Center Middle behaving wierdly


travd93

Recommended Posts

Hi All,

Much has been learnt and heaps of progress has been made since my last post,

Coming across something weird now however.

 

If you inspect my test site here http://mrt.guardian1.com.au:57005/test2/index_template.php

you will see that in the footer I cannot seem to get the 3 divs to allign.

 

Can someone please point me in the right direction on what css to apply.

 

Specifically this is the HTML for the footer

<div data-role="footer" class="footer" data-id="footer" data-position="fixed">	<div>	<div>	<button onclick="history.go(0)" class="medbtn ui-btn ui-corner-all ui-icon-refresh ui-btn-icon-left" data-role="button" data-icon="refresh" >Refresh</button>	<button id="gps_address" class="medbtn ui-btn ui-corner-all ui-icon-navigation ui-btn-icon-left" data-role="button" data-icon="refresh" >Current Location ?</button>	</div>	<div class="center">	<label>YCH-882</label>	</div>	<div class="time right">	<span id="time" /><script src="custom/time.js"></script>	</div>	</div></div>

and this is the css

.footer{	display: block;	}.time{	margin-right:15px;	margin-top:8px;	}.right{	text-align: right;}.center{	text-align: center;}
Link to comment
Share on other sites

They are block elements. Block elements always take the full width of their container and they stack vertically, so one is ontop of another and they don't share horizontal space.

 

What you could do is to float them left and give them a 33.33% width. You would have to remove all margin and padding for that. You can put margin and padding on elements inside the boxes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...