Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I center with the div tag?

Posted on 2012-03-21
2
Medium Priority
?
231 Views
Last Modified: 2012-03-21
Hi, I want to center the right section on the top here that is next to the slideshow images on the left.  I defintely want the text, current edition, to be center to the space on the right.  How do I know how much space is left on the right side?  The total wideth is 800px.   How can I do that?  I tried the following div but it's not working.  Thank you.
http://keckmed.usc.edu/pp/


       <div style="width:350; margin: 0 auto;">
            <img alt="Keck Hospital" src="img/hospitals_header.jpg"/><br style="margin-top:20px"/><a href="http://www.usc.edu/hsc/info/pr/hospital_newsletter/index.html" style="font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#900">Current Edition</a>
            <br/>
            <hr style="width:370px"/>
            <img alt="TheWeekly" style="margin-top: 22px" src="img/TheWeeklyCover-2011.jpg"/><br style="margin-top:10px"/><a href="http://theweekly.usc.edu/1vol17/www11.html" style="font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#900">Current Edition</a>
      </div>                                                      <br/>
0
Comment
Question by:lapucca
2 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 2000 total points
ID: 37749467
To center a div on screen you need
margin-left: auto ;
margin-right: auto ;
0
 

Author Closing Comment

by:lapucca
ID: 37749656
Thank you. I need those and this text-align:center and it's wroking now.  thank you.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question