How to Vertically Center an Object
This is how you would vertically center an object inside a container with CSS in Sitemasher.
1. Consider two items:
a. Container – this is the thing in which you want your object centered
b. Item – this is the item that you want to be centered
2. The container and item must both have fixed height, ie: auto-height must not be checked.
3. Drag the Item into the Container
4. Select the Item, then using the Visual Style Editor
a. Set the "margin-top" property to 50%
b. Set the "top" property to negative half the height of the item. (if the item height is 100px , set the "top" property to -50px)
5. That's it!
1. Consider two items:
a. Container – this is the thing in which you want your object centered
b. Item – this is the item that you want to be centered
2. The container and item must both have fixed height, ie: auto-height must not be checked.
3. Drag the Item into the Container
4. Select the Item, then using the Visual Style Editor
a. Set the "margin-top" property to 50%
b. Set the "top" property to negative half the height of the item. (if the item height is 100px , set the "top" property to -50px)
5. That's it!
1
person likes this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
Loading Profile...

