Page not opening in new tab


#1


More link Attribute in course Common HTML Elements


I do not get error messages it is just that when I click the link that I incorporated into my test page it takes to long to wait for it too load and I tried to test the code my self and when I did it took me to the intended page except it didn't open in a new tab like expected. Why doesn't the code make a new tab open (totally new tab) but, it just uses the current page to show the kinked page


<a href = "https://en.wikipedia.org/wiki/Brown_bear" target ="_blank" >Learn more </a>


#2

because the lessons display a webpage (your little output on the right) in a webpage (the whole lesson), this causes problem, if you right click and select: open in new tab, it should work


#3

I also tried testing the code in Windows Notepad or AKA notoepad and when I ran the code through Google Chrome the link did the same thing. Do you know why?


#4

i put the code on jsbin, it works fine


#5

Does my code not do something?

<!-- Example code -->
<!DOCTYPE html>
<html>
<head>
  <title>Animals around the world</title>
</head>
<body>
  <h1>The Brown Bear</h1>

 A section that describes the brown bear (uses Unordred lists and ordered lists) -->

  <p>The brown bear (Ursus arctos) is native to parts of northern Eurasia and North America. 
Its conservation status is currently "Least Concern." There are many subspecies within the brown bear species, 
including the Atlas bear and the Himalayan brown bear.</p>
  <a href="https://en.wikipedia.org/wiki/Brown_bear">Learn More</a>
  <p>Here are some bear species:</p>
  <ul>
    <li>Arctos</li>
    <li>Collarus</li>
    <li>Horribilis</li>
    <li>Nelsoni (extinct)</li>
  </ul>
  <p>The following countries have the largest populations of brown bears:</p>
  <ol>
    <li>Russia</li>
    <li>United States</li>
    <li>Canada</li>
  </ol>
  <a href="#" target="_blank">
    <img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg" /></a>
</body> 
</html>

<!-- Test for Target Attribute-->
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<a href = "https://en.wikipedia.org/wiki/Brown_bear" target ="_blank" >Learn more </a>
</body>
</html>

#6

So now I'm really confused. I tried your code in Note Pad and it works perfectly and mine still doesn't. When I post your code here it both; yours and mine don't work.


#7

I really appreciate all the help or the effort. Thanks


#8

this one:

<a href="https://en.wikipedia.org/wiki/Brown_bear">Learn More</a>

should work, but doesn't open in new tab

this one:

<a href="#" target="_blank">

the href is #, nothing happens. # is what we use for placeholder if we don't yet know what the url is going to be


#9

Thanks again :slight_smile:


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.