0
上我只有把問題的Html紅寶石軌頁
<a href=""></a>
,但沒有任何鏈接...我不知道爲什麼,如果我點擊任何其他3張圖片吧已鏈接到此頁面。此頁面中的唯一鏈接位於位於左上角的徽標中。如果我點擊那個標誌,它會將我引向主要頁面/索引,這是我想要的,但不適用於我在頁面中放置的圖片或文字。我無法找到問題,爲什麼如果我點擊標誌以外的任何東西,它就會鏈接到這個頁面,就像它令人耳目一新。
#logo {
\t position: absolute;
\t top: 20px;
}
body {
\t background-color: white;
}
#border {
\t border:3px #a7304f solid;
}
#recipeborder1{
border:4px solid #a7304f;
background-color: white;
padding:none;
position: absolute;
width: 750px;
margin-top: 160px;
left: 18%;
}
#recipeborder2{
border:4px solid #a7304f;
background-color: white;
padding:none;
position: absolute;
width: 750px;
margin-top: 450px;
left: 18%;
}
#recipeborder3{
border:4px solid #a7304f;
background-color: white;
padding:none;
position: absolute;
width: 750px;
margin-top: 740px;
left: 18%;
}
.pic{
height:250px;
width:280px;
}
<head>
<meta Content-Type:text/html; charset="UTF-8">
<title> 자취밥상2 </title>
</head>
<body leftmargin="60" rightmargin="50" topmargin="5" bottommargin="80">
<div id="logo">
\t <a href="http://localhost:3000/mainpage/index"><img src="/assets/logo2.png"/>
</div>
<div>
<table id="recipeborder1" border= 0 cellpadding="5" cellspacing = "0">
\t <tr id = " border" >
\t \t <th id = "border" rowspan="4"><a href=""><img src="/assets/food10.jpg" class="pic"/></a> </th>
\t \t <th id = "border" colspan="2"> 자취 떡볶이 </th>
\t </tr>
\t <tr>
\t \t <td id = "border" width = "100" style="text-align:center">재료</td>
\t \t <td id = "border" width = "400" style="text-align:center" >#떡 #파 #고추장 #계란 #라면 </td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >예상시간</td>
\t \t <td id = "border" style="text-align:center" >15분</td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >도구</td>
\t \t <td id = "border" style="text-align:center" >#후라이팬 #전자렌지 #노오븐</td>
\t </tr>
</table>
</div>
<div>
<table id="recipeborder2" border=0 cellpadding="5" cellspacing = "0">
\t <tr>
\t \t <th id = "border" rowspan="4"><a href=""><img src="/assets/food11.jpg" class="pic"/></a></th>
\t \t <th id = "border" colspan="2"> 베이컨 볶음 우동 </th>
\t </tr>
\t <tr>
\t \t <td id = "border" width = "100" style="text-align:center" >재료</td>
\t \t <td id = "border" width = "400" style="text-align:center" >#우동사리 #베이컨 #양파 #마늘 #달걀 # 설탕 #소금 </td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >예상시간</td>
\t \t <td id = "border" style="text-align:center" >20분</td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >도구</td>
\t \t <td id = "border" style="text-align:center" >#후라이팬 #노오븐</td>
\t </tr>
</table>
</div>
<div>
<table id="recipeborder3" border=0 cellpadding="5" cellspacing = "0">
\t <tr>
\t \t <th id = "border" rowspan="4"><a href=""><img src="https://i.imgur.com/P5i7vql.jpg" class="pic"/></a> </th>
\t \t <th id = "border" colspan="2"> 에그 샐러드 샌드위치 </th>
\t </tr>
\t <tr>
\t \t <td id = "border" width = "100" style="text-align:center" >재료</td>
\t \t <td id = "border" width = "400" style="text-align:center" >#모닝빵 #마요네즈 #설탕 #햄 #달걀 #양파 #당근 </td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >예상시간</td>
\t \t <td id = "border" style="text-align:center" >10분</td>
\t </tr>
\t <tr>
\t \t <td id = "border" style="text-align:center" >도구</td>
\t \t <td id = "border" style="text-align:center" >#후라이팬 #노오븐</td>
\t </tr>
</body>
</div>
我不完全確定你在做什麼,但是我會在你的鏈接中加入一個錨點或東西作爲默認值,即使它還沒有鏈接。 因此,而不是'',把'' https://html.spec.whatwg.org/#the-a-element –