首页htmlui_olHTML Element Style - 如何在UL LI导航菜单列表中使用IMG

HTML Element Style - 如何在UL LI导航菜单列表中使用IMG

我们想知道如何在UL LI导航菜单列表中使用IMG。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ul li {
  white-space: nowrap;
}

ul li img {
  margin-left: 10px;
  vertical-align: middle;
}
</style>
</head>
<body>
  <ul>
    <li>This is the LI text. 
       <img  src="http://www.w3cschool.cn/style/download.png" width="24" height="24">
    </li>
    <li>This is the LI text. 
       <img  src="http://www.w3cschool.cn/style/download.png" width="24" height="24">
    </li>
    <li>This is the LI text. 
       <img  src="http://www.w3cschool.cn/style/download.png" width="24" height="24">
    </li>
    <li>This is the LI text. 
       <img  src="http://www.w3cschool.cn/style/download.png" width="24" height="24">
    </li>
    <li>This is the LI text. 
       <img  src="http://www.w3cschool.cn/style/download.png" width="24" height="24">
    </li>
  </ul>
</body>
</html>