Computing.Net > Forums > Web Development > div realign

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

div realign

Reply to Message Icon

Name: Ruisu
Date: May 20, 2009 at 19:55:53 Pacific
OS: Windows XP Pro -32
CPU/Ram: 4400GHz, 6GB
Product: Gigabyte / Nvdaacpi
Subcategory: General
Comment:

Hey,
Sorry about my lack of script but i wrote a web page, then set it up to use a CSS script for formatting. I am trying to make a div actually move to the center of the page but all i seem to be able to get is the text to center within its box.;
text-align: center
and
<div class="mpar" align="center">
Neither of which move the box, only the text it contains.

and the CSS contains

.mpar {
background-color: #003921;
width: 500px;
overflow: auto;
border: 1px solid #000000
}



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: May 20, 2009 at 22:52:03 Pacific
Reply:

You can try something similar to

<div style="position: relative; left: 33%;
           width: 33%; border: 1px solid #000000">my div</div>

or perhaps

<center><div>my div</div></center>

or another one might be

<table width="500" align="center">
<tr>
   <td width="100%" align="center" valign="top">
      <div>my div</div>
   </td>
</tr>
</table>

HTH

______________________
My work in progress. I hate JS. :P


0

Response Number 2
Name: Ruisu
Date: May 21, 2009 at 00:00:45 Pacific
Reply:

Haha, once again I find myself even further into your debt.

As you suggested I found that using <center> tags
worked for what I was after.

Thank you ever so much for your help, i am deeply grateful.


0

Response Number 3
Name: shutat
Date: May 21, 2009 at 01:43:04 Pacific
Reply:

lol... no debt collections here. :P I'm glad I could be of use; best of luck to you with your project(s).

______________________
My work in progress. I hate JS. :P


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: div realign

Div Positionging in Menu Problem www.computing.net/answers/webdevel/div-positionging-in-menu-problem/2322.html

Help with div layers and background www.computing.net/answers/webdevel/help-with-div-layers-and-background/2257.html

Div tag www.computing.net/answers/webdevel/div-tag/365.html