【发布时间】:2017-02-24 20:03:34
【问题描述】:
我正在尝试制作一个 2x2 表格,以便布局在一行上是“任务说明”和“图片 UMES”,然后是“2017”和第二行上的无序列表,但似乎无法弄清楚,它都显示为一个列表。
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
h1 {
background-color: gray;
color: black;
font-family: Verdana
}
h2 {
color: gray;
font-family: Verdana
}
h3 {
font-family: Verdana
}
table {
background-color: white
}
th {
background-color: black;
color: white;
font-size: smaller
}
td {
background-color: gray;
font-size: smaller
}
body {
font-family: Arial;
color: black;
background-color: white
}
address {
font-family: "Courier New", monospace;
font-size: larger
}
</style>
</head>
<body>
<h1>University of Maryland Eastern Shore </h1>
<table>
<tr width="100%">
<h2> UMES Mission Statement </h2>
<th> Picture UMES </th>
</tr>
<tr>
<body> 2017 </body>
<td>
<ul>
<li> Picture of <a href="hawk_mascot.jpg"> our mascot </a> </li>
<li> Picture of <a href="UMES_Campus.jpg"> our campus </a> </li>
</ul>
</td>
</tr>
</table>
</body>
</html>
【问题讨论】:
-
请在您的问题中发布您的代码。见minimal reproducible example
-
刚刚意识到我没有添加,抱歉,这里是新手
-
您的 HTML 在多个地方无效。首先尝试通过验证器运行它。例如:validator.w3.org/#validate_by_input
-
Matthew,这是定位方面的目标,但“MissionStatement”和“2017”应该是白色背景的,我之前尝试过,但它与背景混淆跨度>
-
Raj 有答案......你出错的地方是你应该只使用
th和td作为tr的直接子代
标签: html html-table