Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link a img id="logo"

Tags:

html

css

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 :/

like image 254
user2465543 Avatar asked Jun 13 '13 10:06

user2465543


People also ask

How do I get the URL of an IMG tag?

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.

How do you add a link to a logo?

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.

How do you put an image as ID in HTML?

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.


2 Answers

<a href="www.example.com"><img id="logo" src="nsc/logo2.png" alt="logo" /></a>
like image 171
Antony Avatar answered Sep 26 '22 13:09

Antony


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 :)

like image 21
Ravi Gadag Avatar answered Sep 25 '22 13:09

Ravi Gadag