Solved

How can I center with the div tag?

Posted on 2012-03-21
2
211 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 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now