用ul做一個云標簽

效果


Paste_Image.png

1、控制位置

ul>li 去掉原本樣式

ul { list-style: none; }

ul>li 背景

.cloud ul li:nth-child(8n-7) {/* background: #8A9B0F; */}
  .cloud ul li:nth-child(8n-6) { background: #EB6841 }
  .cloud ul li:nth-child(8n-5) { background: #3FB8AF }
  .cloud ul li:nth-child(8n-4) { background: #FE4365 }
  .cloud ul li:nth-child(8n-3) { background: #FC9D9A }
  .cloud ul li:nth-child(8n-2) {background: #EDC951;}
  .cloud ul li:nth-child(8n-1) { background: #C8C8A9 }
  .cloud ul li:nth-child(8n) { background: #83AF9B }
  .cloud ul li:first-child {/* background: #036564 */}
  .cloud ul li:last-child { background: #3299BB }

ul>li 不獨占一行

float: left;
<html>
<meta charset="utf-8">
<body>
<style>
.cloud{
  width: 300px; */
  margin-left: 100px;
  margin-top: 100px;
  background-color: beige;
}
.cloud ul { list-style: none; }
.cloud ul li {
  -o-transition: all 0.5s;
  background: #FC9D9A;
  margin: 2px;
  line-height: 24px;
  float: left;
  border-radius: 8px;
  margin: 10px 10px 0 0;
  padding: 3px 5px;
  -moz-transition: all 0.5s;
}
.cloud ul li a {
    color: #FFF;
}
.cloud a:link, a:visited {
  text-decoration: none;
}
.cloud ul li:nth-child(8n-7) {/* background: #8A9B0F; */}
.cloud ul li:nth-child(8n-6) { background: #EB6841 }
.cloud ul li:nth-child(8n-5) { background: #3FB8AF }
.cloud ul li:nth-child(8n-4) { background: #FE4365 }
.cloud ul li:nth-child(8n-3) { background: #FC9D9A }
.cloud ul li:nth-child(8n-2) {background: #EDC951;}
.cloud ul li:nth-child(8n-1) { background: #C8C8A9 }
.cloud ul li:nth-child(8n) { background: #83AF9B }
.cloud ul li:first-child {/* background: #036564 */}
.cloud ul li:last-child { background: #3299BB }
.cloud ul li:hover { border-radius: 0; text-shadow: #000 1px 1px 1px }

</style>
<div class="cloud">
    <ul>
      <li><a href="/">個人博客</a></li>
      <li><a href="/">web開發(fā)</a></li>
      <li><a href="/">前端設(shè)計</a></li>
      <li><a href="/">Html</a></li>
      <li><a href="/">CSS3</a></li>
      <li><a href="/">Html5+css3</a></li>
      <li><a href="/">百度</a></li>
      <li><a href="/">Javasript</a></li>
      <li><a href="/">web開發(fā)</a></li>
      <li><a href="/">前端設(shè)計</a></li>
      <li><a href="/">Html</a></li>
      <li><a href="/">CSS3</a></li>
      <li><a href="/">Html5+css3</a></li>
      <li><a href="/">百度</a></li>
    </ul>
  </div>
</body>
</html>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 問答題47 /72 常見瀏覽器兼容性問題與解決方案? 參考答案 (1)瀏覽器兼容問題一:不同瀏覽器的標簽默認的外補...
    _Yfling閱讀 14,189評論 1 92
  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 179,319評論 25 708
  • ?前端面試題匯總 一、HTML和CSS 21 你做的頁面在哪些流覽器測試過?這些瀏覽器的內(nèi)核分別是什么? ...
    Simon_s閱讀 2,389評論 0 8
  • 一:在制作一個Web應(yīng)用或Web站點的過程中,你是如何考慮他的UI、安全性、高性能、SEO、可維護性以及技術(shù)因素的...
    Arno_z閱讀 1,369評論 0 1
  • 宋澎
    冰風落葉閱讀 217評論 0 0

友情鏈接更多精彩內(nèi)容