473,394 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

aligh div in center position and it was contain two div both are flot in left

hai i am satheesh i am a student,

actually i was make a one web page, here it contain one parent div, and the parent div contain three div,

how can i align center for the children div

code are follow:
Expand|Select|Wrap|Line Numbers
  1. <div style="width:100%; height:100%; background:#99FFCC; margin:auto;" align="center" >
  2.     <div style="background-color:#999999;">
  3.       <div style="background-color:#FF0000; width:400px; height:100px; float:left;">children div 1</div>
  4.       <div style="background-color:#FF0000; width:400px; height:100px;float:left;">children div 2</div>
  5.       <div style="background-color:#FF0000; width:400px; height:100px;float:left;">children div 3</div>
  6.     </div>
  7. </div>
  8.  
but i expect for the child div in flot:left, because all div in single row


please any body help me sir !!!!!!!!!!!!!!!!!
Oct 4 '09 #1
1 2603
TheServant
1,168 Expert 1GB
There is only one legitimate way to center divs on the web and that's using:
Expand|Select|Wrap|Line Numbers
  1. margin: 0 auto;
. Now the other issue is that requires your parent dive to be given a width. So in your second level div, with the background-color: #999999, add in:
Expand|Select|Wrap|Line Numbers
  1. display: block;
  2. margin: 0 auto;
  3. width: 800px;
And then go from there. Welcome to Bytes.
Oct 15 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tony Vasquez | last post by:
Can somoene give me an example of how to center a div, according to it's image size... I am using different images, and so I have to resize it in a functino according to the image's size. So I use...
27
by: FL | last post by:
Hi Everyone, I know howto center a block using margin-left: auto ; margin-right: auto ; but I'm trying to center vertically a box, any idea to solve this?
32
by: Axel Dahmen | last post by:
Hi, I've posted this question a few months ago but didn't get a truly satisfying answer then. So I'd like to post my question again: How can I center a DIV? The content in the DIV should be...
2
by: sylvian stone | last post by:
Hi, I'm trying to do something that has always been easy with tables - namely use a three column layout, and above the main layout, show three images - one on the absolute left, one on the absolute...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
19
roula
by: roula | last post by:
I HATE DIVS AND DIFFERENT BROWSERS!!! i spent the whole day and night searching for a way to center align stupid divs, the problem is that the code is so sensitive, i lost my mind trying to make them...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
11
by: Mel | last post by:
Does anyone know a way to center the info. on a webpage? I want my web site to work like MySpace.com where the page content remains centered when I resize the browser window. For the life of me I...
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.