Go Back   Computer Juice > Computer Software > Web Design, Hosting & SEO
Register Points Members New Posts Donate Unanswered Posts Site Spy Search

>>> Get Paid to Hang Out Here! Activity = Points = Prizes. Want to Know More? <<<

Reply
 
LinkBack Thread Tools
  #1  
Old 20-03-2007, 02:54 PM
No Avatar
CJ Member
 
twopointoh is offline
 
Join Date: Mar 2007
Last Online: 23-03-2007 02:52 AM
Posts: 32
iTrader: (0)
twopointoh is on a distinguished road
Default How do i align a div in the center?

How do I align a Div in the center of a page? I know that it is probably very easy but either I'm missing something or my mind has gone blank. ASAP please!

The Div is 780px wide so it'll fill 600x800 resolution but not on bigger ones, so can I align it with html or CSS?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #2  
Old 20-03-2007, 03:19 PM
No Avatar
CJ Member
 
crimsonc is offline
 
Join Date: Mar 2007
Last Online: 08-06-2007 02:42 PM
Posts: 143
iTrader: (0)
crimsonc is on a distinguished road
Default How do i align a div in the center?

Oh easy easy easy. All you have to do is set the margins of THAT Div to auto, like this

Code:
#div_name
{
  margin: auto;
}
This will set the margins left and right as automatic. Automatically...they are whatever they need to be to center the element

Simple as that!

Last edited by crimsonc : 20-03-2007 at 03:20 PM.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #3  
Old 20-03-2007, 03:30 PM
No Avatar
CJ Member
 
twopointoh is offline
 
Join Date: Mar 2007
Last Online: 23-03-2007 02:52 AM
Posts: 32
iTrader: (0)
twopointoh is on a distinguished road
Default How do i align a div in the center?

I feel so stupid for not realising that, it's pretty obvious really isn't it. It's great i've used it and it works fine. Glad you were around to give me a hand or I would feel even worse haha.

I suppose I should have another look at W3C to remind myself of CSS.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #4  
Old 20-03-2007, 03:32 PM
No Avatar
CJ Member
 
crimsonc is offline
 
Join Date: Mar 2007
Last Online: 08-06-2007 02:42 PM
Posts: 143
iTrader: (0)
crimsonc is on a distinguished road
Default How do i align a div in the center?

Hey it's no problem.

Programing (or indeed design) languages need to be looked at as building blocks.

You want to build a castle and you have all these pieces, the trick is working out how to get from your 'pile of pieces' to a mighty castle!

It might be handy to go and brush up though, it was indeed a basic thing to know, but you shouldn't feel bad about it.

CSS is an excellent language and important to learn!
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote

Please support this forum, donate towards our running costs.


Reply


Thread Tools

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
xp media center edition download, help me Cew27 Windows Operating Systems 1 13-04-2008 05:00 PM
Windows Media Center ComputerGuy Windows Operating Systems 2 28-09-2007 12:37 AM
Windows Media Center Cryphyx Windows Operating Systems 3 02-09-2007 07:13 AM
ATI Catalyst Control Center? thedementedman Graphics Cards & Monitors 1 31-03-2007 04:05 AM


Copyright ©2006 - 2008 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2008 Jelsoft Enterprises Ltd. SEO by vBSEO ©2008, Crawlability, Inc.

Page copy protected against web site content infringement by Copyscape