html - creating simple tag cloud in css -
i trying create tag cloud in css.
for example if have 5 links (<a href)
in same line , want 1 appear little , link little down , in same line.i tried padding-top:20px
, display:block
making link move next line.
<style> .cloud { height:200px; } .cloud1 { font-size:26px; margin-top:2px; } .cloud2 { font-size:18px; margin-top:5px; } </style> <div class="cloud"> <a class="cloud1" target="_blank" href="">movie</a> </span> <a class="cloud2" target="_blank" href="">news</a> </span> <a class="cloud2" target="_blank" href="">movie</a> </span> <a class="cloud1" target="_blank" href="">123</a> </span> <br> <a class="cloud1" target="_blank" href="">rand</a> </span> <a class="cloud2" target="_blank" href="">news</a> </span> <a class="cloud2" target="_blank" href="">movie</a> </span> <a class="cloud1" target="_blank" href="">ok</a> </span> </div>
here http://jsfiddle.net/fznjydyd/ play.i tried various things in display,position,margin,padding .but nothing seems me.
you can set position: relative .cloud
, position: absolute
.cloud-x
, give position desired each.
like this
<div class="cloud"> <a href="" class="tag cloud1">aaaaa</a> <a href="" class="tag cloud2">bbbbb</a> <a href="" class="tag cloud3">ccccc</a> <a href="" class="tag cloud4">ddddd</a> <a href="" class="tag cloud5">ddddd</a> </div> .cloud{ height: 200px; width: 200px; position: relative; } .tag{ position: absolute; } .cloud1{ top: 10px; left: 5px; } .cloud2{ right: 10px; top: 15px; } .cloud3{ bottom: 20px; left: 55px; } .cloud4{ top: 90px; left: 155px; } .cloud5{ top: 70px; left: 65px; }
it hard if have many tags works, , can it.
i code jsfiddle show you can. :)
Comments
Post a Comment