html - How do I link <li> with local file? -


i have following code link local files. local file located in same place current html file located. how can modify following code link local file?

<ul>   <li><a href="#news">news</a></li>   <li><a href="#q&a">q&a</a></li>   <li><a href="#contact">contact</a></li>   <li><a href="#about">about</a></li>   <li><a href="#fun">fun</a></li> </ul> 

for example: if user click on news, news page should open users, , on.

the code have provided correct, looking link each <li> different location not the #news, understand. first of all, have make sure want news should link to?

1. how link news specific part of website? `

for example, linking h1 has #news id:

<ul>   <li><a href="#news">news</a></li> </ul>  <h1 id="news"></h1> 

2. how link external source?

the following code helps link news external link.

<ul>   <li><a href="http://stackoverflow.com/">news</a></li> </ul> 

3. how link file?

the following code helps link news local file have. example, have news.html file located in same folder of current html file.

<ul>   <li><a href="news.html">news</a></li> </ul> 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -