Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > HTML / XHTML
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 11-04-2009, 05:48 PM
  #1
mickcalcara
Novice (Level 1)
 
Join Date: Nov 2009
Posts: 1
iTrader: (0)
mickcalcara is an unknown quantity at this point
help with centering content in DIV

Please help me with the following. This is not a problem in Firefox; only in IE. I am having trouble centering one DIV with a DIV to the left of the centered DIV. The DIV that is blue I would like centered according to the browser width and the red DIV I would like the same vertically as the blue DIV only left justified. In Firefox this works correctly the way I would expect. In IE the left justified div appears "pushes" the DIV ( in blue ) that I want centered further to the right; making it un-centered. thanks for any assistance.

Code:
<div width="100%">
			<div align = "left" style="width:200px;float:left;background-color:#ff0000;">
						<p style="font-size: 8pt;">This needs to be left justified........</p>
						<p style="font-size: 8pt;">This needs to be left justified........</p>
						<p style="font-size: 8pt;">This needs to be left justified........</p>
			</div>
		 <div align="center" style="background-color:#00ff00;">
				<div style="width: 500px;background-color:#0000ff;">
					<p style="font-size: 8pt;">this needs to be centered.................................................................................. </p>
					<p style="font-size: 8pt;">this needs to be centered.................................................................................. </p>
					<p style="font-size: 8pt;">this needs to be centered.................................................................................. </p>
					<p style="font-size: 8pt;">this needs to be centered </p>
				</div>
		</div>

Last edited by mickcalcara : 11-04-2009 at 06:05 PM.
mickcalcara is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 11-04-2009, 08:01 PM
  #2
Code_worm
Aspirant (Level 2)
 
Join Date: Oct 2009
Location: scotland
Posts: 15
iTrader: (0)
Code_worm is an unknown quantity at this point
I think you are using the wrong syntax...
instead of align = centre
it should be
HTML Code:
text-align:center;
if that doesn't work for alignin text within a div i suggest trying to use the same code but make a class for the paragraph tag <p> and align the text within that tag
like this...
HTML Code:
<p style="font-size: 8pt;text-align:centre;">
Hope this helps
Code_worm is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 03:35 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.