TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
William Thompson
1.6k
155
298.5k
How do I center a <div> vertically?
Oct 19 2011 1:23 PM
How do I center a <div> vertically?
I have managed to horizontally align a Div object. Here is how I did it. I got the width and the height of the object I wanted to center (XAML CODE)
[HTML]<Grid Background="White" Height="300" Width="738" VerticalAlignment="Center" HorizontalAlignment="Center">[/HTML]
Then, in the html file that hosts the silverlight control I did this:
[HTML] <div id="silverlightControlHost" style="width:738px; height: 300px; margin-top:auto; margin-bottom:auto; margin-left: auto; text-align:center; margin-right: auto;">[/HTML]
That puts the control centered horizontally at the top of the web page.
Now, how do I center it vertically?
Reply
Answers (
0
)
linq to datagrid...crazy
C# Threaded Discussion Forum Tutorial