2017-09-15 84 views
-4

这是我正在使用的代码。出于某种原因,MSN.com下的所有内容都将成为链接。我检查了我的CSS,并且我假设问题出现在那里,但是想要先看看它是从HTMl方面发生的事情。我写的所有HTML都变得链接了(不使用hrefs)?

<a href="http:msn.com" target="blank"><img class="makeBlock" src="images/scenery.jpg" alt="This is a clickable image"></a><br><br> 
<!-- One way to utilize this functionality is to have a nice image button saved and use that to link to stuff --> 

<!-- An array of images that are thumbnail size that be clicked to go to a new window for the bigger version --> 
<a href="http://yahoo.com" target="blank"><img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
<a href="http://yahoo.com" target="blank"><img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
<a href="http://yahoo.com" target="blank"><img src="http://freeforcommercialuse.net/wp-content/uploads/2017/08/msp_1701_4269.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
<a href="http://yahoo.com" target="blank"><img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
<a href="http://yahoo.com" target="blank"><img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
<a href="http://google.com" target="blank"><img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 

<br> 
<br> 

</div> 

<!-- The below is to create an image map using coordinats so people can click on different areas and go different places --> 

<img src="http://freeforcommercialuse.net/wp-content/uploads/2017/08/msp_1701_4269.jpg" usemap="#scenery"> 
<map name="scenery"> 
<area shape="rect" alt="Left side strong side" coords="0,10,536,614" href="https://nba.com" target="blank"> 
</map> 

<!-- An unordered list is called a bullet list. An ordered list is with numbers --> 

<ul> 
    <li>Sun</li> 
    <li>Moon</li> 
    <li>Test</li> 
</ul> 

<ol> 
    <li>Ordered Sun</li> 
    <li>Ordered Moon</li> 
    <li>Ordered Test</li> 
</ol> 

<table> 
    <tr> 
     <td>Apples R1C1</td> 
     <td>Oranges R1C2</td> 
    </tr> 
    <tr> 
     <td>Pears R2C1</td> 
     <td>Peaches R2C2</td> 
    </tr> 
</table> 

+0

欢迎来到Stack Overflow!投票结束,因为这个问题是由于无法再现的问题或简单的印刷错误造成的。虽然类似的问题可能在这里讨论,但这个问题的解决方式不太可能有助于未来的读者。 –

回答

0

你缺少结束标记的所有定位元素。结构应该看起来像这样<a></a>

或使用一个你的例子

<a href="http://google.com" target="blank"> 
    <img src="images/scenery.jpg" alt="thumbnail size to link" width="width 52" height="70"> 
</a> 
0

你有没有在你的代码关闭</a>正常。

+0

https://fiddle.jshell.net/n3u1cwx0/ – Santhosh

+0

谢谢! Jeez我知道这很简单,我花了半个多小时尝试一切,但除此之外。 – sundizz

0

你永远不会用</a>来关闭你的元素。

相关问题