Solved

How can I center with the div tag?

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Custom list that contains notes and documents for meetings? 2 33
Unable to sync from Onedrive 4 45
DataTables-Form Input column not sorting 7 74
SharePoint 2013 with K2 5 23
Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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