Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在页面上拉伸图像导航栏?_Html_Css - Fatal编程技术网

Html 在页面上拉伸图像导航栏?

Html 在页面上拉伸图像导航栏?,html,css,Html,Css,我肯定以前有人问过我这个问题,所以我很抱歉,但是我找不到一个适合我的答案——或者也许我就是不明白 我是HTML和CSS方面的新手,我正在尝试构建一个图像导航栏,可以延伸到屏幕宽度的100%。如果有人能告诉我我错过了什么,那就太好了。链接将在稍后更改 <body> <ul> <li><a href="index.html"> <img src="images/logo.png" height="80" widt

我肯定以前有人问过我这个问题,所以我很抱歉,但是我找不到一个适合我的答案——或者也许我就是不明白

我是HTML和CSS方面的新手,我正在尝试构建一个图像导航栏,可以延伸到屏幕宽度的100%。如果有人能告诉我我错过了什么,那就太好了。链接将在稍后更改

<body>
<ul>
    <li><a href="index.html">
             <img src="images/logo.png" height="80" width="150">
        </a>
    </li>
    <div id="menu">
        <li>
             <a href="index.html">
                   <img src="images/homeButton.png" height="80" width="150"></a>
        </li>
        <li>
              <a href="index.html">
                   <img src="images/scratchButton.png" height="80" width="150">
              </a>
        </li>
        <li>
              <a href="index.html">
                   <img src="images/c++Button.png" height="80" width="150">
              </a>
        </li>
        <li>
             <a href="index.html"> 
                   <img src="images/PythonButton.png" height="80" width="150">
             </a>
        </li>
        <li>
             <a href="index.html">
                   <img src="images/signInButton.png" height="80" width="150">
             </a>
        </li>
    </div>
</ul>

您可以使用一个表,将列指定为相等的宽度,并将其放置在一个占据100%宽度的div中

例如:

<div id="container">
<table>
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%"> // maybe you can make all five statements at once
<tr>
<td>1st/td>
<td>2nd</td>
<td>3rd</td>
<td>4th</td>
<td>5th</td>
</tr>
</table>
</div>

//也许你可以同时做五个陈述
第一次/td>
第二
第三
第四
第五

<div id="container">
<table>
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%"> // maybe you can make all five statements at once
<tr>
<td>1st/td>
<td>2nd</td>
<td>3rd</td>
<td>4th</td>
<td>5th</td>
</tr>
</table>
</div>