0
Why isn't the <nav> section of this code working?I mean if i click on about me why isn't it taking me to the about me section?
16 Answers
+ 1
here is your working code i made some correction in it
https://code.sololearn.com/Wcxi29u0WnJq/?ref=app
+ 3
You have several errors and issues in your html code in addition to what @Calvin said.
Your nav tag isn't closed as well as your action tag. You're using a tags incorrectly and treating them both as a self closing tag in addition to the closing tag. <a .... />...</a> is wrong should be like <a ... >...</a>.
Your table header row should look more like:
<tr><th></th><th>Course</th><th>Status</th><th>Result</th><th>Year</th></tr>
use of classes is incorrect:
<section class="about me"><h2>About Me</h2>
about and me are two separate classes when written like this (space seperated). What you really want is an id anyhow:
<section id="about-me"><h2>About Me</h2>
Then in your anchor (<a></a>) tags href use href="#about-me" instead.
+ 3
now I fully understand.....thanks guys
+ 2
You cant use Css class for href redirect. Use Css id instead.
+ 2
Just change it to href="#about-me" and About Us div set to id="about-me"
Btw, ".about me" or "#about me" is wrong way to refer to class or id name, ".about-me" or "#about-me" is correct.
You can use lots of id selectors in one html document, make sure the the id names are unique.
+ 2
Except @Suresh's code still has most of the other errors included in it. A tags are wrong, table header is wrong, and the action tag isn't closed.
+ 2
You should not use the exact same id more than once in a page. You can have 1 different id per tag just fine.
+ 1
thanks guys
+ 1
Why do you reluctant to use id? Do you know you can have multiple classes and an id selector in one tag?
+ 1
yes , and all the best for ur page
+ 1
You only cannot use the same id name in one document. You can use as many ids as you want provided the name of the id are different.
0
got it....but in the course they said id cannot be used more than once in a page...
0
The course is right. Id can use only once.
0
then what should i do to solve the problem?
0
awesome suresh....now I dont have to use id and I can also style the page by adding class in it....
0
@Calvin because the course said one should not use id more than once in a page