Solved

How do we center the contents for the following css file? thanks

Posted on 2011-09-20
4
167 Views
Last Modified: 2012-06-27
#container
{
    width: 98%;
    margin: 10px auto;
    background-color: white;
    color: #333;
   
}


#top
{
    height: 100px;
    width: 98%;
}



#topleft
{
    float: left;
    width: 20%;
}


#topcenter
{
    float: left;
    width: 55%;
}
#topright
{
    border-color: #FFFFFF;
    border-width: 5px;
    float: right;
    width: 23%;
    background-color: #800000;
    font-family: 'Times New Roman' , Times, serif;
    font-size: medium;
    color: #FFFFFF;
}
0
Comment
Question by:goodk
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 250 total points
Comment Utility
0
 
LVL 15

Assisted Solution

by:Jagadishwor Dulal
Jagadishwor Dulal earned 250 total points
Comment Utility
you may have problem that you did not see the page in center that is because you have used 98% width. Your css is ok just make some fixed width for container div and for top bottom use percentage like below:

#container
{
    width: 980px;
    margin: 25% auto;
    background-color: white;
    color: #333;
   
}

Open in new window

0
 

Author Comment

by:goodk
Comment Utility
It does not work; I was asking how the entire #topcenter div would appear in the center; not the contents.  

All I want is one container with three sections inside and all sections centered.  I know I can move the sections by putting margin-left, but this is not a proportionate solution.

If the user makes the page smaller then these sections start to move under the other.  Which is not desirable.

Anyway I am confuse.. please help!


0
 

Author Closing Comment

by:goodk
Comment Utility
thanks for trying..
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

728 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

8 Experts available now in Live!

Get 1:1 Help Now