I have - img id="logo" SO I can have my logo on my website, the full code for it being:
<img id="logo" src="nsc/logo2.png" alt="logo" />
How can I link this logo image using <a href="">
???
I've tried many different ways but they don't work :/
To use image as a link in HTML, use the <img> tag as well as the <a> tag with the href attribute. The <img> tag is for using an image in a web page and the <a> tag is for adding a link. Under the image tag src attribute, add the URL of the image.
Using a Menu or Button To Add the LinkIf you have a menu option to insert a link, click to highlight the logo image and choose that option. If you have a button in an HTML editor, click to highlight the logo and click the button. Type the URL for the link, when prompted.
The value of the id attribute must be unique within the HTML document. The id attribute is used to point to a specific style declaration in a style sheet. It is also used by JavaScript to access and manipulate the element with the specific id. The syntax for id is: write a hash character (#), followed by an id name.
<a href="www.example.com"><img id="logo" src="nsc/logo2.png" alt="logo" /></a>
It would be nice to embed in a link tag. :)
<a href="your.html">
<img id="logo" src="nsc/logo2.png" alt="BrandLog" />
</a>
it's clean and no need of javascript :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With