今天就先寫個LI 的簡單應用~~以后慢慢加好了

這是一個普通的LI <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/ " /> 国产欧美二区,亚洲风情在线资源站,麻豆中文一区二区

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

li的簡單應用

作者:eoe
雖然自己天天寫CSS~~
可是來了原創文章這里~~不知道要寫什么~~

今天就先寫個LI 的簡單應用~~以后慢慢加好了

這是一個普通的LI
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>li的簡單應用</title>
</head>
<body>
<div id="test">
<ul>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
</ul>
</div>
</body>
</html>
   提示:你可以先修改部分代碼再運行

加了點CSS樣式定義可以這樣


  引用: 
*{margin:0;padding:0;} 習慣性把所有的元素的內補丁外補丁定義為0
0可以沒有單位~~理論上是要單位的~不過0px 0pt 0em 都是0 所以~懶了~~

#test ul li 是 包含選擇符
定義ID為test 里面的ul里的li
margin:~在基本所有的瀏覽器解析都是一樣~
這里之所有要寫兩個是因為~
在li里面有我用到border,IE5.x對border的解析與其他瀏覽器不一樣
margin/**/: 這樣的話~IE5.x是不認識的~~
當然還有其他的寫法如:
voice-family :   "/"}/"";voice-family :inherit;等~
可參考http://bbs.51js.com/viewthread.php?tid=50475&fpage=1

 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>li的簡單應用</title>
<style type="text/css">
*{margin:0;padding:0;}
#test
{
width:300px;
margin:5px;
}
#test ul li
{
margin:3px;/* for IE5.x*/
margin/*/*/:1px;
list-style-type:none;
font:normal  normal normal ಌpx/2em  helvetica,Arial, verdana;
border:1px #004080 solid;
background: #fefefe url('http://bbs.51js.com/images/smilies/icon1.gif')  no-repeat left center;
padding-left:20px;

}

</style>
</head>
<body>
<div id="test">
<ul>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
  <li>測試列表的
</li>
</ul>
</div>
</body>
</html>
   提示:你可以先修改部分代碼再運行

再加上類如日期之類的內容


  引用: 
span定義為float:right 他會跟在后面 




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>li的簡單應用</title>
<style type="text/css">
*{margin:0;padding:0;}
#test
{
width:300px;
margin:5px;
}
#test ul li
{
margin:3px;/* for IE5.x*/
margin/*/*/:1px;
list-style-type:none;
font:normal  normal normal ಌpx/2em  helvetica,Arial, verdana;
border:1px #004080 solid;
background: #fefefe url('http://bbs.51js.com/images/smilies/icon1.gif')  no-repeat left center;
padding-left:20px;

}
#test ul li span
{
margin:0px 5px;
float:right;
}
</style>
</head>
<body>
<div id="test">
<ul>
  <li><span>12-11</span>測試列表的
</li>
  <li><span>12-11</span>測試列表的
</li>
  <li><span>12-11</span>測試列表的
</li>
  <li><span>12-11</span>測試列表的
</li>
</ul>
</div>
</body>
</html>
   提示:你可以先修改部分代碼再運行

再加更多的內容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>li的簡單應用</title>
<style type="text/css">
*{margin:0;padding:0;}
#test
{
width:300px;
margin:5px;
}
#test ul li
{
margin:3px;/* for IE5.x*/
margin/*/*/:1px;
list-style-type:none;
font:normal  normal normal ಌpx/1em  helvetica,Arial, verdana;
border:1px #004080 solid;
}
#test ul li h4
{
font:normal  normal normal ಌpx/2em  helvetica,Arial, verdana;
padding-left:20px;
background: #fefefe url('http://bbs.51js.com/images/smilies/icon1.gif')  no-repeat left center;

}
#test ul li p
{
padding:2px;
}
#test ul li span
{
margin:0px 5px;
float:right;
}
</style>
</head>
<body>
<div id="test">
<ul>
  <li><h4><span>12-11</span>測試列表的</h4>
<p>測試列表的測試列表的測試列表的測試列表的測試列表的</p>
</li>
  <li><h4><span>12-11</span>測試列表的</h4>
<p>測試列表的測試列表的測試列表的</p>
</li>
  <li><h4><span>12-11</span>測試列表的</h4>
<p>測試列表的測試列表的測試列表的</p>
</li>
  <li><h4><span>12-11</span>測試列表的</h4>
<p>測試列表的測試列表的測試列表的</p>
</li>
</ul>
</div>
</body>
</html>

HTML/CSS技術li的簡單應用,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 克东县| 通榆县| 申扎县| 留坝县| 从江县| SHOW| 扎兰屯市| 辰溪县| 巴东县| 虞城县| 霍邱县| 随州市| 库伦旗| 乐都县| 汉川市| 建宁县| 南江县| 太谷县| 闽清县| 三明市| 呼和浩特市| 宣威市| 阜平县| 湖口县| 永城市| 郴州市| 鹤峰县| 禄丰县| 武城县| 富裕县| 大竹县| 邵武市| 康平县| 隆回县| 闸北区| 黄龙县| 玛曲县| 南川市| 高唐县| 青田县| 松滋市|