Sign in for recommendations. New member? Start here.

CSS examples - Centred Floats

markschneg rated 21 months ago
From the page: "The premise is simple and basically just involves a widthless float that is placed 50% from the left using position:relative. The nested inner element is then reversed and a negative relative position of 50% (-50%) is applied. This has the effect of placing the element in the ce...

Do you like this page from pmob.co.uk? Yes, I like it

Tell us what you like and we will show you more pages like it with our recommendation engine.

2 Reviews

Characters left: 4000


ToreadorVampire rated 2 months ago
I always forget the specifics of this technique - this page is a good reminder. Centre floated elements like nav lists and buttons etc.
markschneg rated 21 months ago
From the page: "The premise is simple and basically just involves a widthless float that is placed 50% from the left using position:relative. The nested inner element is then reversed and a negative relative position of 50% (-50%) is applied. This has the effect of placing the element in the center. Relative positioning maintains the flow and allows other content to flow underneath."