travd93 Posted February 11, 2015 Share Posted February 11, 2015 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 More sharing options...
Ingolme Posted February 11, 2015 Share Posted February 11, 2015 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 More sharing options...
dzhax Posted February 16, 2015 Share Posted February 16, 2015 you can also display: inline-block; to make them print on the same line. Link to comment Share on other sites More sharing options...
travd93 Posted February 16, 2015 Author Share Posted February 16, 2015 (edited) Trying style="float: left; width: 33.33%" on the individual divs for now Edited February 16, 2015 by travd93 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now