dalawh Posted June 30, 2012 Share Posted June 30, 2012 Is there any way to center floating elements? I tried using something similar to http://www.pmob.co.uk/pob/centred-float.htm, but it always came out a little uneven. I need something that is absolutely in the center. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 30, 2012 Share Posted June 30, 2012 I've used this method lots of times, and it always centres for me? it depends what html elements you are using to centre, many come with default padding, margin and even text-indent, which require you to give a zero value, to truly centre. Link to comment Share on other sites More sharing options...
dalawh Posted June 30, 2012 Author Share Posted June 30, 2012 I've used this method lots of times, and it always centres for me? it depends what html elements you are using to centre, many come with default padding, margin and even text-indent, which require you to give a zero value, to truly centre.If you look at what they used, it is not centered. It is off to the right by a bit. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 30, 2012 Share Posted June 30, 2012 No, it is centred to the parent container it is in, the parent container has a margin that places it approx 25px away from the left side panel, while on the right the margin is about 10px; Link to comment Share on other sites More sharing options...
dalawh Posted July 1, 2012 Author Share Posted July 1, 2012 No, it is centred to the parent container it is in, the parent container has a margin that places it approx 25px away from the left side panel, while on the right the margin is about 10px;Wouldn't that make it not centered? You said the left margin was approx 25px and the right margin is 10px. It seems if I don't use form and use buttons instead, the text-align:center works fine. Link to comment Share on other sites More sharing options...
dsonesuk Posted July 1, 2012 Share Posted July 1, 2012 ??? I don't know what form/buttons has to do with centring navigation menu. Wouldn't that make it not centered? You said the left margin was approx 25px and the right margin is 10px. The outer parent container is off centre to the white content area, the menu is centred to this outer parent container, it like comparing a car tyre being centred to the mudguard, but its not centred to the car body itself. IF i use web developer ruler it has equal distance from outer menu edges to outer parent container edges of 502px exactly. Link to comment Share on other sites More sharing options...
dalawh Posted July 1, 2012 Author Share Posted July 1, 2012 ??? I don't know what form/buttons has to do with centring navigation menu. The outer parent container is off centre to the white content area, the menu is centred to this outer parent container, it like comparing a car tyre being centred to the mudguard, but its not centred to the car body itself. IF i use web developer ruler it has equal distance from outer menu edges to outer parent container edges of 502px exactly.When I used a form and input, text-align:center did not work, but when I changed it to just buttons, it worked fine. Oh okay. I tried the same method and it was off a bit. Won't be needing it now, so it doesn't matter. 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