Solved

How can I center with the div tag?

Posted on 2012-03-21
2
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 500 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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