Links, buttons and wraps

When I make a link button or wrap an image with a href, I can only select the web address by using the left mouse button.

is there a way to have it so that when the right mouse button is clicked on the button/image it will take me directly to the URL

	<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
	<title>About Me</title>
	<img src=""/>
	<p>We're Codecademy! We're here to help you learn to code.</p><br/><br/>
		<a href="">Sims Industrial Design</a>

Do you mean when you left-click the link you’re not being taken to the url?

It’s not conventional to use a right-click to follow a link. Most browsers will open a context menu when you right-click on a link, and from that context menu you’ll be able to do things like open the link in a new tab, copy the link, etc.

It’s not a good idea to override this default behavior unless you have a very good reason to, and anyway I don’t think it’s possible to do with just HTML and CSS.

I don’t see any buttons or images wrapped with a link in your code, I only see a plain link <a href="">Sims Industrial Design</a> . Is that the link you’re having a problem with?

1 Like

Sorry I got L/R confused when writing my question. when I select the link with the right mouse button I get the option of opening the URL.

My question was is it possible, to select the link by just using the left mouse button (and the same for images that have a wrap)?

You mentioned that you do not think that it is possible with HTML/CSS if so what language?

P.S I was just supplying the code as an example of how I normally write it, my q was in general.



I thing @katlandreth is pointing at jQuery…
If you load the jQuery environment via <script></script> tag within your <head></head> tag
you would have loaded a whole bunch of faciltiies like

The course about jQuery requires you to have some ex[erience with Javascript

1 Like

I’m not sure what you mean by [quote=“koda82, post:3, topic:30097”]
is it possible, to select the link by just using the left mouse button

What do you mean by “select” in this case? Just clicking on it? Or are you trying to copy it or something?

I’m just going to guess that you either want to

A left-click the link and be taken to the URL (the default behavior) or

B you want to left-click the link to copy the link’s URL so you can paste it somewhere else

Just to sum up:

  1. The link you posted works correctly. If you want left-click to take you to the URL of the link, and this link doesn’t work for you, there must be a problem somewhere with your setup.
  2. If you’re trying to make the left-click action do something other than the default, that’s not usually a good idea. Anyone clicking the link who doesn’t know you changed the default action might be confused, frustrated, or think the link is broken.
  3. If you do have a good reason to change the left-click behavior for your website, as @leonhard.wettengmx.n said, you could do it with JQuery, and actually probably with vanilla JavaScript. These are more advanced than HTML and CSS.

Last thing, if you want left-click to copy the link’s URL - and this is just a behavior you want, for your own use - there are browser plugins that will add a “left-click to copy link location” action to your computer. It won’t make left-click work differently for anyone else so no one will be confused about why links don’t take them to a URL. Do a search for “left-click copy link location” to find some of these plugins.

1 Like

I need help with drawing the button i’m stuck on the part with the div and the height,width,border colors and the background color plz help me i’m in 5 grade:cry::(:frowning: ;(

To left click the mouse.

You will have to look for solutions in
== discussions / opinions ==
or other articles
google search
copy a link left click the mouse

how can we call function and its sub function