473,387 Members | 1,516 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,387 software developers and data experts.

Div in Div Centred Issue

384 256MB
I have a div in a div and can't seem to centre it at all, its really annoying me now, I've googled the hell out of it, any ideas?

I've removed all centring code, so this is how the code looks now.

Expand|Select|Wrap|Line Numbers
  1. <div id="board_container">
  2.     <div id="board_inner_container">&nbsp;</div>
  3. </div>
Expand|Select|Wrap|Line Numbers
  1. #board_container {
  2.     float: left;
  3.     width: 800px; /* Defines mx width of board */
  4.     border: 1px #CCCCCC solid;
  5.     clear: left;
  6.     display: inline;
  7. }
  8. #board_inner_container {
  9.     float: left;
  10.     width: 98%;
  11.     border: 1px #CCCCCC solid;
  12.     clear: left;
  13.     display: inline;
  14. }
Jul 10 '09 #1
3 1387
drhowarddrfine
7,435 Expert 4TB
Inline elements can not be centered because they are 'inline', that is, just like a sentence in a paragraph. In a block all to their own.
Jul 10 '09 #2
ziycon
384 256MB
Makes sense, the only reason I'm using the inline option is to fix the rendering issues with border/padding/margins in IE, is there any way around this?

Tried this and it didn't work either:
Expand|Select|Wrap|Line Numbers
  1. #board_inner_container {
  2.     float: left;
  3.     width: 98%;
  4.     margin-left: auto;
  5.     margin-right: auto;
  6.     border: 1px #CCCCCC solid;
  7.     clear: left;
  8. }
Jul 10 '09 #3
Jezternz
145 100+
Expand|Select|Wrap|Line Numbers
  1. float:left
Will prevent it from centering as far as I know. Thats the only specific problem I see.
Jul 10 '09 #4

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

Similar topics

7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
6
by: martin.eyles | last post by:
I am having a problem with this page:- http://www.bytronic.com/tests/centre.html I want a nice centred paragraph, but get a justified paragraph. I expected the .centre to override the #content...
17
by: Alan Silver | last post by:
Hello, If you look at http://www.kidsinaction.org.uk/Thumbs.html you will see a simplified version of a page that could be used to display thumbnail images of various products. Now, due to...
4
by: Alan Silver | last post by:
Suppose I have a div that contains the content of my page. I would like to have this div centred in the browser, with a (say) 10px margin on either side. So far, no problem... (WARNING - the HTML...
1
by: Socrates | last post by:
Hi - Have tried for half and hour to get this script to work: I am trying to close the parent window while opening a centred new child window I would be grateful if someone could correct the...
0
by: william.oram | last post by:
Consider the table cell <td<!--Adding 'height=100 style="vertical-align:middle"' makes it easier to view --> <form> <input name="button" type=button value=Go> </form> </td> This will...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.