Link to home
Start Free TrialLog in
Avatar of matdot
matdot

asked on

<div> text align help

I need help in aligning text in a <div>.  Here is what I have:

<div id="pageid" class="blah">
 <ul>
   <li id="blah1"><a href="page1.php">page1</a></li>
   <li id="blah2"><a href="page2.php">page2</a></li>
   <li id="blah3"><a href="page3.php">page3</a></li>
 </ul>
</div>

What I'm trying to do is have page1 aligned to the left and page2 and page3 aligned on the right.  They are all on the same line.
ASKER CERTIFIED SOLUTION
Avatar of sagacitysolutions
sagacitysolutions
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of matdot
matdot

ASKER

hey sagacitysolutions, thanks for the reply but I still get them all aligned on the left
Is the DIV inside a table cell
or
Try This
<div id="pageid" class="blah" style="width:300px">
 <ul>
   <li id="blah1" style="text-align:left "><a href="page1.php">page1</a></li>
   <li id="blah2" style="text-align:right "><a href="page2.php">page2</a></li>
   <li id="blah3" style="text-align:right "><a href="page3.php">page3</a></li>
 </ul>
</div>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi,

ensure - 'pageid'  contains property float: left;

#pageid {
     float: left;
     etc...

}


alternatively change it to - float: right;

bottom line - if you want <div> to align horizontally you must state the "float" property.

hope this helps

andy