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.
<div id="pageid" class="blah">
<ul>
<li id="blah1"><a href="page1.php">page1</a>
<li id="blah2"><a href="page2.php">page2</a>
<li id="blah3"><a href="page3.php">page3</a>
</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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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>
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 id="blah2" style="text-align:right "><a href="page2.php">page2</a>
<li id="blah3" style="text-align:right "><a href="page3.php">page3</a>
</ul>
</div>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER