CSS-Styled列表:例子,指南和最佳实践

Different Uses of Styled Lists

1-Custom Select Box

Ordered Lists


Js代码 复制代码
  1. <dl class="dropdown">   
  2. <dt id="two-ddheader" οnmοuseοver="ddMenu('two',1)" οnmοuseοut="ddMenu('two',-1)" class="module">Recent Archives</dt>   
  3.   
  4. <dd id="two-ddcontent" οnmοuseοver="cancelHide('two')" οnmοuseοut="ddMenu('two',-1)">   
  5. <ul>   
  6.     <li><a href='http://www.darrenhoyt.com/2008/06/' title='June 2008'>June 2008</a></li>   
  7.     <li><a href='http://www.darrenhoyt.com/2008/05/' title='May 2008'>May 2008</a></li>   
  8.     <li><a href='http://www.darrenhoyt.com/2008/04/' title='April 2008'>April 2008</a></li>   
  9. </ul>   
  10. </dd>   
  11. </dl>  
 

2-Code Blocks

Ordered Lists


<div id="portfolio">
<ul id="gallery">
<li><img src="/{client}/before.jpg" /></li>
<li><img src="/{client}/sketch.jpg" /></li>
<li><img src="/{client}/wireframe.jpg" /></li>
<li><img src="/{client}/after.jpg" /></li>
</ul>
<img id="frame" width="580" height="415" src="frame.png" />
<ul id="sequence">
<li id="before"><a href="/{client}/before.jpg"><a></li>
<li id="sketch"><a href="/{client}/sketch.jpg"><a></li>
<li id="wireframe"><a href="/{client}/wireframe.jpg"><a></li>
<li id="after"><a href="/{client}/after.jpg"><a></li>
</ul>
<a id="launch" rel="external" href="{url}">
<img src="launch.png" alt="Launch this site" />
</a>
</div>



3-Tabs

unOrdered Lists


<ul id="home_button">
  <li><a href="javascript:void(0)" onMouseOver="showContent('home_welcome_content','home_button_welcome')" id="home_button_welcome" class="on">Welcome</a></li>
  <!-- <li><a href="javascript:void(0)" onMouseOver="showContent('home_mymonterey_content','home_button_mymonterey')" id="home_button_mymonterey">My Monterey</a></li> -->
  <li><a href="javascript:void(0)" onMouseOver="showContent('home_visitors_content','home_button_visitors')" id="home_button_visitors">Visitor's Guide</a></li>
  <li><a href="javascript:void(0)" onMouseOver="showContent('home_multimedia_content','home_button_multimedia')" id="home_button_multimedia">Multimedia Gallery</a></li>
  <!-- <li><a href="javascript:void(0)" onMouseOver="showContent('home_travelblog_content','home_button_travel')" id="home_button_travel">Travel Blog</a></li> -->
  <li><a href="javascript:void(0)" onMouseOver="showContent('home_weather_content','home_button_weather')" id="home_button_weather">Weather</a></li>
  <li><a href="javascript:void(0)" onMouseOver="showContent('home_surf_content','home_button_surf')" id="home_button_surf">Surf Report</a></li>
</ul>




4-Post’s Information

unOrdered Lists


<ul>
  <li class="dateposted">Posted on: 19th November 2006</li>
  <li>Posted by: <a href="http://ifelse.co.uk">Phu</a></li>
  <li>Number of comments: <a href="http://ifelse.co.uk/archives/2006/11/19/cssedit-2-review/#comments">29</a></li>
  <li><a href="http://ifelse.co.uk/archives/2006/11/19/cssedit-2-review/#commentform">Add a comment</a></li>
</ul>


5-Popular Posts Block

unOrdered Lists


6-Blog’s Comment

unOrdered Lists


7-CSS Galleries

unOrdered Lists


8-Text Blocks

unOrdered Lists


Tutorials and Examples

1-Nested lists used to create a simple folder metaphore

unOrdered Lists


2-Mini Slide Navigation

unOrdered Lists


3-html vs css pt2/navigation lists

 /* html code */  <li><a class="item"> nav item </a></li>  <li class="active"><span class="item"> nav item </span></li>  /* css code */  li .item {display:block; padding:0.5em;}  /* css code alternative */  li a, li span {display:block; padding:0.5em;}



4-Floating next and back buttons using lists

unOrdered Lists


 /* html code */  <li><a class="item"> nav item </a></li>  <li class="active"><span class="item"> nav item </span></li>  /* css code */  li .item {display:block; padding:0.5em;}  /* css code alternative */  li a, li span {display:block; padding:0.5em;}



5-Safe Lists Next to Left-Floated Elements

unOrdered Lists


6-Style Your Ordered List

unOrdered Lists


7-Centering List Items Horizontally

unOrdered Lists


8-Advanced CSS Menu Trick

unOrdered Lists


9-A Stripe of List Style Inspiration

unOrdered Lists

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值