Welcome Guest! (App Version 3.1)
IntroductionHTML Tutorial What is HTML? My First Program in HTML Doctype Block Elements in HTML Inline Elements in HTML
Box ModelWhat is Box Model Content in Box Model Padding in Box Model Border in Box Model Margin in Box Model
HTML TagsDiv Tags H1 to H6 Tags Paragraphs Tags Span Tags Bold Tags Italic Tags
HTML UtilitiesAdding Images Adding Hyperlinks Adding Comments Types of Lists Tables Iframes Breaking Lines Horizontal Line
FormsForms in HTML Text-Box Radio Checkbox Select and Option Text Area Button Submit
HTML 5What is new in HTML5 Syntax Changes New Elements & Properties Semantic Tags New Elements New Input Types Graphics Support Canvas SVG Media Support Audio Video Client Side Storage Local Storage Session Storage Indexed DB Web SQL [dep] Cookies API Support Web Worker Web Sockets Service Worker App Cache [dep] SSE Drag & Drop Geolocation
HTML QuizHTML Quiz 1
hrefattribute contains url of the link to navigate to.
Anchor tags are used to add hyperlinks to other web pages or even to other web sites. There may be cases where you want your users to click and go to some other page - that page might reside on your own website or it might direct to some other website like facebook, google, twitter, etc.
In anchor tags there is a property 'href'. In this property just add the website address where you want your users to redirect to on clicking the text inside anchor tags. You may even direct the user to some part of the web page he is currently on.
<a href="http://www.google.com"> Google </a>
Look at the example below to understand how anchor tag works:
<body> <!-- hyperlink to text --> <a href="http://www.google.com">Google</a> <!-- hyperlink to image --> <a href="http://www.google.com"> <img src="../img/google.png" /> </a> </body>