Hydrian Posted September 2, 2012 Share Posted September 2, 2012 I have a div which needs to be in the center but it acts as if there is a div in the way. here is my css http://pastebin.com/AUwdVnkn here is my index http://pastebin.com/SMR1QNWw Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/ Share on other sites More sharing options...
hakimserwa Posted September 2, 2012 Share Posted September 2, 2012 whats the name of the div Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1374715 Share on other sites More sharing options...
Hydrian Posted September 2, 2012 Author Share Posted September 2, 2012 content Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1374718 Share on other sites More sharing options...
spiderwell Posted September 3, 2012 Share Posted September 3, 2012 content is float left Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1374855 Share on other sites More sharing options...
White_Lily Posted September 3, 2012 Share Posted September 3, 2012 okay - simple thing to solve. In the CSS file replace "float:left;" with: margin: auto; Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1374871 Share on other sites More sharing options...
matthewtbaker Posted October 26, 2012 Share Posted October 26, 2012 margin: 0 auto; is the answer. You do seem to have a lot of: Used within your layout. Perhaps consider a different method which is friendly for mobile browsers. Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1387859 Share on other sites More sharing options...
codefossa Posted October 26, 2012 Share Posted October 26, 2012 As Matthew said, you should use margin: 0 auto; to center an element. Also, if you're trying to float something under another floating object, you would use clear: {left, right, both};. Only one of them though, obviously. Link to comment https://forums.phpfreaks.com/topic/267917-alignment-not-working/#findComment-1387867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.