pheonixkid
pheonixkid

Reputation: 111

issue in Html ruby on rails page

i have only put the

<a href=""></a>

in the pictures but without any links... i have no idea why if i click on any of the other 3 pictures it is linked to this page. The only link in this page is in the logo which is located in the top-left corner. If i click on that logo it leads me to the mainpage/index which is what i want, but not for pictures or words i have put in the page. I couldnt find the problem to why if i click on anything other than the logo it is linked to this page like it is refreshing.

#logo {
	position: absolute;
	top: 20px;
}

 body {
 	background-color: white;
 }
 
 #border {
 	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">
	<a href="http://localhost:3000/mainpage/index"><img src="/assets/logo2.png"/>
</div>



 

<div>
<table id="recipeborder1" border= 0 cellpadding="5" cellspacing = "0">
	<tr id = " border" >
		<th id = "border" rowspan="4"><a href=""><img src="/assets/food10.jpg" class="pic"/></a> </th>
		<th id = "border" colspan="2"> 자취 떡볶이 </th>
	</tr>

	<tr>
		<td id = "border" width = "100" style="text-align:center">재료</td>
		<td id = "border" width = "400" style="text-align:center" >#떡 #파 #고추장 #계란 #라면 </td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >예상시간</td>
		<td id = "border" style="text-align:center" >15분</td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >도구</td>
		<td id = "border" style="text-align:center" >#후라이팬 #전자렌지 #노오븐</td>
	</tr>
</table>
</div>

<div>
<table id="recipeborder2" border=0 cellpadding="5" cellspacing = "0">
	<tr>
		<th id = "border" rowspan="4"><a href=""><img src="/assets/food11.jpg" class="pic"/></a></th>
		<th id = "border" colspan="2"> 베이컨 볶음 우동 </th>
	</tr>

	<tr>
		<td id = "border" width = "100" style="text-align:center" >재료</td>
		<td id = "border"  width = "400" style="text-align:center" >#우동사리 #베이컨 #양파 #마늘 #달걀 # 설탕 #소금  </td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >예상시간</td>
		<td id = "border" style="text-align:center" >20분</td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >도구</td>
		<td id = "border" style="text-align:center" >#후라이팬 #노오븐</td>
	</tr>
</table>
</div>


<div>
<table id="recipeborder3" border=0 cellpadding="5" cellspacing = "0">
	<tr>
		<th  id = "border" rowspan="4"><a href=""><img src="https://i.imgur.com/P5i7vql.jpg" class="pic"/></a> </th>
		<th  id = "border" colspan="2"> 에그 샐러드 샌드위치 </th>
	</tr>

	<tr>
		<td id = "border" width = "100" style="text-align:center" >재료</td>
		<td id = "border" width = "400" style="text-align:center" >#모닝빵 #마요네즈 #설탕 #햄 #달걀 #양파 #당근  </td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >예상시간</td>
		<td id = "border" style="text-align:center" >10분</td>
	</tr>

	<tr>
		<td id = "border" style="text-align:center" >도구</td>
		<td id = "border" style="text-align:center" >#후라이팬 #노오븐</td>
	</tr>
</body>
</div>

Upvotes: 0

Views: 28

Answers (1)

SESN
SESN

Reputation: 1283

You have forget to close the a tag in the logo. Another one mistake in code is body tag is closing before div.

<div id="logo">
    <a href="http://localhost:3000/mainpage/index"><img src="/assets/logo2.png"/></a>
</div>

Upvotes: 1

Related Questions