Jump to content

Div align

- - - - -

  • Please log in to reply
1 reply to this topic

#1
VakhoQ

VakhoQ

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
I have just make 5 divs,



<div style="border-style:solid;  border-width:2px;  width:1024px; position:absolute;">  /* the main div */


<div style="float:left; width:200px;"><a href="#">1</a></div>

<div style="float:left; width:200px;"><a href="#">2</a></div>

<div style="float:left; width:200px;"><a href="#">3</a></div>

<div style="float:left; width:200px;"><a href="#">4</a></div>

<div style="float:left; width:200px;"><a href="#">5</a></div>


</div>

now I want to move this div in the center of the monitor. but align="center" does not work here.. could you help me?

I'm working here: http://vakho.comyr.com/wiksi/
the div have to be in the center.
GNU/Linux Is the Best.

#2
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
use :

<div style="border-style:solid;  border-width:2px;  width:1024px;margin:0 auto;">  /* the main div */ 


<div style="float:left; width:200px;"><a href="#">1</a></div> 

<div style="float:left; width:200px;"><a href="#">2</a></div> 

<div style="float:left; width:200px;"><a href="#">3</a></div> 

<div style="float:left; width:200px;"><a href="#">4</a></div> 

<div style="float:left; width:200px;"><a href="#">5</a></div> 


</div> 

margin:0 auto; works when the width of the div is fixed/specified in css.
Also I'm not sure if you really need the "position:absolute;" in the outer div style
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users