Advertisement
Guest User

CSS list: inline-block

a guest
May 27th, 2010
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.39 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html lang="en">
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  5.     <title>List using inline-block</title>
  6.     <style type="text/css">
  7. body {
  8.   font: normal 62.5%/1.5 verdana,sans-serif;
  9. }
  10.  
  11. ul {
  12.   width: 400px;
  13.   display: block;
  14.   line-height: 2;
  15. }
  16.  
  17. li {
  18.   display: inline-block;
  19.   background: lightyellow;
  20.   margin-right:8px;
  21. }
  22.  
  23. .x {
  24.   padding-left:2px;
  25.   padding-right:2px;
  26.   background:rgb(196,15,24); /*dark red*/
  27.   -moz-border-radius:10px;
  28.   -webkit-border-radius:10px;
  29.   text-decoration:none;
  30.   color:#fff;
  31. }
  32.  
  33. .x span {
  34.   position: relative;
  35.   top:-2px;
  36. }
  37.  
  38. .x:focus, .x:hover {
  39.     background:red;
  40. }
  41.     </style>
  42.     <!--[if lte IE 7]><style type="text/css">
  43. li {
  44.  display: inline;
  45.  zoom:1;
  46. }  
  47.     </style><![endif]-->
  48. </head>
  49. <body>
  50. <h1>List of tags, thou can suppress them</h1>
  51. <ul>
  52.     <li><a href="#" class="txt">Biotechnology</a> <a href="#" title="Suppress the Biotechnology tag" class="x"><span>x</span></a></li>
  53.     <li><a href="#" class="txt">it's&nbsp;tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  54.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  55.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  56.     <li><a href="#" class="txt">short</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  57.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  58.     <li><a href="#" class="txt">blah</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  59.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  60.     <li><a href="#" class="txt">abcdefgh</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  61.     <li><a href="#" class="txt">lorem ipsum</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  62.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  63.     <li><a href="#" class="txt">it's a nice tag</a> <a href="#" title="Suppress the --- tag" class="x"><span>x</span></a></li>
  64. </ul>
  65. </body>
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement