CSS에서 인식 할 수있는 클래스의 id를 얻지 못하는 것 같습니다. 여기에 코드가 있습니다. 내가 간단한 것을 놓치고있는 것처럼 보이지만 그것이 무엇인지 알아 내거나 보지 못하는 것 같습니다.PHP에서 id가 작동하지 않습니다.
echo "<table class='item'>
<tr>
<td id='name'><h3>" . $name . "</h3></td>
<td id='itemdescription'>" . $description . "</td>
<td id='imagelocaiton'><img src='" . $location . "'id='image'></td>
<td id='price'>" . $price . "</td>";
와 관련된 CSS :
#image {
width: 300px;
height: auto;
}
#itemdescription {
color: red;
}
감사합니다!
EDIT : 이것은 inspect 요소의 출력 HTML입니다. MySQL 데이터베이스에서 테이블 정보를 그리는 while 루프를 사용하여이 ID를 수정해야한다고 가정해야합니다. 난 그냥 ... 내 CSS는 구글 크롬하지만 사파리를 사용하여 작동하는 것 같다 것으로 나타났습니다
<html><head>
<title>For Sale</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css"></style></head>
<body>
<div class="item_list">
<table class="item">
<tbody><tr>
<td id="name"><h3>had</h3></td>
<td id="itemdescription">adfafdsaf</td>
<td id="imagelocaiton"><img src="images/simple.gif" id="image"></td>
<td id="price">$0</td></tr></tbody></table><table class="item">
<tbody><tr>
<td id="name"><h3>Idkd</h3></td>
<td id="itemdescription">adfaf</td>
<td id="imagelocaiton"><img src="images/Airplane Logo.jpg" id="image"></td>
<td id="price">$0</td></tr></tbody></table><table class="item">
<tbody><tr>
<td id="name"><h3>adfag</h3></td>
<td id="itemdescription">adfaf</td>
<td id="imagelocaiton"><img src="images/Jason.jpeg" id="image"></td>
<td id="price">$1313</td></tr></tbody></table><table class="item">
<tbody><tr>
<td id="name"><h3>afaf</h3></td>
<td id="itemdescription">adfafaf</td>
<td id="imagelocaiton"><img src="images/HDR1.jpg" id="image"></td>
<td id="price">$331</td>
나는 아이템 클래스를 놓친 것 같아 .. –
에코 출력을 게시 할 수 있을까요? 아니면 우리가 볼 수있는 URL을 제공합니까? – jameslafferty
@LakshmiPrasanna 제이슨이 ID를 사용하고 있기 때문에 수업에서 차이를 만들어서는 안됩니다. – jameslafferty