+ 1

What does "#" do after href?

9th Jul 2016, 3:40 PM
Abu
Abu - avatar
7 Answers
+ 7
If you mean this syntax: <a href="#">A link</a>, it has nothing to do with IDs. The '#' is used here as placeholder instead of real link/url. It makes a link clickable without taking you anywhere. Good for practicing and testing. When you assign an ID to <a>, it will look like this: <a id="fancy" href="#">link text</a> The CSS is where you use '#': a#fancy { color: orange; }
9th Jul 2016, 7:11 PM
ZinC
ZinC - avatar
+ 1
if you want to keep the user on same page even after clicking that anchor then you can use # after href like <a href="#" >anchor</a>
12th Jul 2016, 6:09 PM
Ajay Pareek
Ajay Pareek - avatar
0
when you link using id then u have to use # In href.
9th Jul 2016, 5:58 PM
Sumit Balia
Sumit Balia - avatar
0
can I have an example please?
9th Jul 2016, 6:21 PM
Abu
Abu - avatar
0
in css # is use to refer for id and . for class eg # {color:black;} change the color of the p tag.
12th Jul 2016, 10:45 AM
Suraj Rathod
Suraj Rathod - avatar
0
placeholder, means to Shang the # to ur link
1st Aug 2016, 4:13 AM
Daliah Aljutayli-ŰŻŰ§Ù„ÙŠÙ‡ Ű§Ù„ŰŹŰ·ÙŠÙ„ÙŠ
Daliah Aljutayli-ŰŻŰ§Ù„ÙŠÙ‡ Ű§Ù„ŰŹŰ·ÙŠÙ„ÙŠ - avatar
- 2
if you want to link with id's like <p id="hello">hello world</p> <a href="#hello">click</a> mostly it's used in one page website or application
9th Jul 2016, 6:25 PM
Sumit Balia
Sumit Balia - avatar