Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1113 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Center content on page

Thread title: Center content on page
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
08-21-2005, 03:20 PM
#1
<Isurfr> is offline <Isurfr>
Status: Member
Join date: Aug 2005
Location: w3c
Expertise:
Software:
 
Posts: 193
iTrader: 0 / 0%
 

<Isurfr> is on a distinguished road

  Old  Center content on page

...

08-21-2005, 04:09 PM
#2
Musoka is offline Musoka
Musoka's Avatar
Status: Member
Join date: Aug 2005
Location: US
Expertise:
Software:
 
Posts: 121
iTrader: 0 / 0%
 

Musoka is on a distinguished road

Send a message via AIM to Musoka Send a message via MSN to Musoka

  Old

Or you can just create a DIV to hold the centered items and set the CSS to "Margin:Auto;"

08-21-2005, 05:24 PM
#3
opserty is offline opserty
Status: I love this place
Join date: Jan 2005
Location: UK, Birmingham
Expertise:
Software:
 
Posts: 606
iTrader: 0 / 0%
 

opserty is on a distinguished road

Send a message via MSN to opserty

  Old

Yer I don't see why you need all the javascript really.

08-21-2005, 05:28 PM
#4
Marky is offline Marky
Status: Ready for Action
Join date: Aug 2005
Location: UK
Expertise:
Software:
 
Posts: 2,775
iTrader: 14 / 100%
 

Marky is on a distinguished road

  Old

yer - Javascript isnt really needed... I just use:

HTML Code:
<p align="center"><font face="Verdana" size="2">Centered</font></p>

08-21-2005, 05:48 PM
#5
design by EMH is offline design by EMH
Status: Member
Join date: Aug 2005
Location: Hampton, VA
Expertise:
Software:
 
Posts: 111
iTrader: 0 / 0%
 

design by EMH is on a distinguished road

Send a message via AIM to design by EMH Send a message via MSN to design by EMH

  Old

Im gonna go with Musoka, all you need to do is create (in your CSS file) a "container" which will look like this:

#container {
margin:auto
}

You can add any other properties you want as well.

And your HTML will look like this:


HTML Code:
<body>
<div id="container">

EVERYTHING GOES HERE!

</div>
</body>

08-21-2005, 06:06 PM
#6
Paul is offline Paul
Status: I love this place
Join date: Apr 2005
Location: Canada
Expertise:
Software:
 
Posts: 723
iTrader: 0 / 0%
 

Paul is on a distinguished road

  Old

.container {
margin: auto:
}

Thats what I would do. All that other crap is ridiculous.

08-21-2005, 06:10 PM
#7
derek lapp is offline derek lapp
Status: design rockstar
Join date: Jan 2005
Location: guelph, ontario
Expertise:
Software:
 
Posts: 2,246
iTrader: 0 / 0%
 

derek lapp is on a distinguished road

  Old

without a width value, margin auto doesn't do anything. divs are soft 100% widths.

08-21-2005, 06:41 PM
#8
<Isurfr> is offline <Isurfr>
Status: Member
Join date: Aug 2005
Location: w3c
Expertise:
Software:
 
Posts: 193
iTrader: 0 / 0%
 

<Isurfr> is on a distinguished road

  Old

...

08-21-2005, 11:13 PM
#9
jono1 is offline jono1
jono1's Avatar
Status: Non-conformist
Join date: Jul 2005
Location: Canberra, Australia.
Expertise:
Software:
 
Posts: 1,172
iTrader: 0 / 0%
 

jono1 is on a distinguished road

  Old

....maybe you could actually say something? you know, so we can figure out what you're getting at?

08-22-2005, 12:28 AM
#10
design by EMH is offline design by EMH
Status: Member
Join date: Aug 2005
Location: Hampton, VA
Expertise:
Software:
 
Posts: 111
iTrader: 0 / 0%
 

design by EMH is on a distinguished road

Send a message via AIM to design by EMH Send a message via MSN to design by EMH

  Old

Originally Posted by dereklapp
without a width value, margin auto doesn't do anything. divs are soft 100% widths.

Oh yeah, sorry. Thank you dereklapp, I forgot to add that you needed a width value.

Closed Thread  
Page 1 of 2 1 2 >


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed