I use the following code making a list of 50 links
<a href="GoTo.htm">
<div style="postion:absolute;top:315px;left:20px>First link</div>
<a href="GoTo.htm">
<div style="postion:absolute;top:315px;left:20px>Second link</div>
........
Is there a way I don't need to set position for every link?
Thanks,
WebJoel
04-26-2006, 02:11 PM
That is begging for troubles... :-(
For vertical links (like navigation for a page), try
<div id="links">
<a href="" title="navigation link #1">Link Name 1</a><br />
<a href="" title="navigation link #2">Link Name 2</a><br />
<a href="" title="navigation link #3">Link Name 3</a><br />
<a href="" title="navigation link #4">Link Name 4</a><br />
<a href="" title="navigation link #5">Link Name 50</a><br />
~~~ etc...
<a href="" title="navigation link #50">Link Name 5</a>
</div>
And style the id "links".
An even better way is to create a "list item" list, like
<div>
<ul>
<li><a href="" title="navigation link #1">Link Name 1</a></li>
<li><a href="" title="navigation link #2">Link Name 1</a></li>
<li><a href="" title="navigation link #3">Link Name 1</a></li>
<li><a href="" title="navigation link #4">Link Name 1</a></li>
<li><a href="" title="navigation link #5">Link Name 1</a></li>
~~~
<li><a href="" title="navigation link #50>Link Name 1</a></li>
</ul>
</div>
And style the <ul> and <li>.
This is the preferred method, as a 'list of links' is exactly that, "listable items".
To make the list 'vertical', add "display:block" to the <ul></li>;
To make the list 'horizontal', add "display:inline" to the <ul></li>.
In both examples I placed these list of links inside of a 'container DIV', in case you want to position THAT (instead of trying to position EVERY LINK, which is chaos-incarnate).
:-)
TaoDay
04-27-2006, 05:52 AM
A - Anchor
Contents Inline elements except A
Contained in Block-level elements, inline elements except A and BUTTON
The A element denotes an anchor--a hypertext link or the destination of a link. The HREF attribute specifies a hypertext link to another resource, such as an HTML document or a JPEG image.
DIV - Generic Block-level Container
Contents Inline elements, block-level elements
Contained in APPLET, BLOCKQUOTE, BODY, BUTTON, CENTER, DD, DEL, DIV, FIELDSET, FORM, IFRAME, INS, LI, MAP, NOFRAMES, NOSCRIPT, OBJECT, TD, TH
The DIV element defines a generic block-level container, allowing authors to provide style or language information to blocks of content. The element may contain any inline or block-level element, including another DIV.
The DIV element is most useful in combination with the CLASS, ID, or LANG attributes. For example, a navigation bar could be contained within a DIV marked as CLASS=navbar, allowing the author to use style sheets to easily change the background of all navigation bars on a site, or to eliminate navigation bars when printing....
So :
block can store inline element or another block. But inline element can store only inline element.
ex:
Right Example:
<div><a href="#">how</a></div>
<a href="#">show <strong>Bold</strong></a>
Wrong Example:
<a href="#"><div>How</div></a>
pcthug
04-28-2006, 02:36 AM
Using Lists is a must! (http://www.alistapart.com/articles/taminglists/)