Assistance with question
The question is telling to set a link for "portfolio" to a navigating like. How can I do it?
<!DOCTYPE html> <html> <head> <title>Portfolio Page</title> </head> <body> <img src="../img/logo.png" alt="Site logo"> <ul> <li><a href="/">Home</a></li> <li><a href="">Portfolio</a></li> </ul> <h1 id="portfolio">My Portfolio</h1> </body> </html>
Nils Kriedner17,069 Points
You link to an id by using the hash tag „#“ followed by the id-name.
So in your example it would look like this:
One little thing that is not wrong but that you should be aware of is indentation. The second list item in your code should better be on the same indentation as the first list item.
So this is correct indentation:
<ul> <li>list-item 1</li> <li>list-item 2</li> </ul>
And this is not so good:
<ul> <li>list-item 1</li> <li>list-item 2</li> </ul> <a href=“#portfolio“>Portfolio</a>
It will still work, there is no problem for the browser. But anybody looking at your code might get confused because it looks like there is another list within a list (which is possible but is not the case here).