I am updating our Intranet from table-based design to CSS and am having problems getting my first/previous/next/last navigation to look right.
Basically it shows |< First and <Previous links if the user is not on the first page and shows the Next > and Last >| links if the user is not on the last page.
My old table-based code looks like this (dynamic code has been omitted),
I would like the same type of navigation with CSS, but I have been unable to get it right.
Here is my new code,
And here is my CSS,
The problem I am having is that when a user is on the first page, the Next > and Last >| links are centered on the page, they are not in place like the table does.
How can I fix this? Or should I just continue to use a table for this?
Thanks,
Drew
Basically it shows |< First and <Previous links if the user is not on the first page and shows the Next > and Last >| links if the user is not on the last page.
My old table-based code looks like this (dynamic code has been omitted),
Code:
<tr>
<td width="25%"><div align="center">
<A HREF="first.htm">I< First</A>
</div></td>
<td width="25%"><div align="center">
<A HREF="previous.htm">< Previous</A>
</div></td>
<td width="25%"><div align="center">
<A HREF="next.htm">Next ></A>
</div></td>
<td width="25%"><div align="center">
<A HREF="last.htm">Last >I</A>
</div></td>
</tr>
I would like the same type of navigation with CSS, but I have been unable to get it right.
Here is my new code,
Code:
<div id="resultsnav">
<ul>
<li><a href="first.htm">|< First</a></li>
<li><a href="previous.htm">< Previous</a></li>
<li><a href="next.htm">Next ></a></li>
<li><a href="last.htm">Last >|</a></li>
</ul>
</div>
And here is my CSS,
Code:
#resultsnav {
size:100%;
text-align:center;
}
#resultsnav ul {
list-style: none;
padding: 0;
margin: 0;
}
#resultsnav ul li {
display: inline;
}
#resultsnav ul li a {
padding: 2% 6%;
font-size: 16px;
}
The problem I am having is that when a user is on the first page, the Next > and Last >| links are centered on the page, they are not in place like the table does.
How can I fix this? Or should I just continue to use a table for this?
Thanks,
Drew