<a> tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

<a> tag

Why doesn't it work when I type <a href="#HOME"> HOME</a> P.S:I want the link to send me to the HOME section located on the page

23rd Jun 2022, 4:41 PM
Olumide Nifemi
15 Answers
+ 3
Olumide Nifemi Your home section id should be HOME then it will work
23rd Jun 2022, 4:52 PM
A͢J
A͢J - avatar
+ 3
You have empty "#" link and code have no <section id="home"> ..? <div id = "HOME"> think this is home section with id = "HOME"</div> use <a href = "#HOME" > HOME </a> Tap on this link will bring to you home section... Hope it helps..
23rd Jun 2022, 5:39 PM
Jayakrishna 🇮🇳
+ 3
You need to add "HOME" as an id for that section Ex: <section id="HOME"> <!-- Home Section --> </section> Now when you click the link that has "#HOME" as a value for its href attribute the page will scroll to the HOME section.
23rd Jun 2022, 6:51 PM
Abdo ACHHOUBI
Abdo ACHHOUBI - avatar
+ 2
Can you share the full code related..!!
23rd Jun 2022, 4:48 PM
Jayakrishna 🇮🇳
+ 2
Set the id of home in your element
23rd Jun 2022, 5:03 PM
Lakshay
Lakshay - avatar
+ 2
Jayakrishna🇮🇳 https://code.sololearn.com/W1g29CmQQw3V/?ref=app Although this isn't the exact code I was asking about, the real code was made on my laptop so it has some issues
23rd Jun 2022, 5:26 PM
Olumide Nifemi
+ 2
Olumide Nifemi <p id="HOME" >Text</p> P tag is an example
23rd Jun 2022, 5:30 PM
Lakshay
Lakshay - avatar
+ 2
Olumide Nifemi Your opening and closing tags are not proper <p> <h1> <font> </p> </font> </h1> Proper is this : <p> <h1> <font> </font> </h1> </p> Inner tag should close first then outer
23rd Jun 2022, 5:40 PM
A͢J
A͢J - avatar
+ 2
Because you need a link like this: <a href=“www.random.com”>some text</a>
24th Jun 2022, 7:43 PM
Fabian's Wereld
Fabian's Wereld - avatar
+ 1
@Lashkay Thanks so much
23rd Jun 2022, 5:43 PM
Olumide Nifemi
+ 1
Thank you all🙏
23rd Jun 2022, 5:45 PM
Olumide Nifemi
+ 1
<a href="#home">Home</a> <div id="home">...</div>
24th Jun 2022, 1:05 PM
Joschi Dev
Joschi Dev - avatar
+ 1
Check your id, correct and run
25th Jun 2022, 10:56 AM
Ranjan Giri
Ranjan Giri - avatar
0
A͢J I wrote this: <section id="home"> <h1> Home</h1> </Section>
23rd Jun 2022, 5:22 PM
Olumide Nifemi
23rd Jun 2022, 5:27 PM
Olumide Nifemi