Friday 6 March 2015

Tag cloud and list layout with css



What I wanted was to style my tags, (labels) which is an unordered list, so the look like the image below.

    Tag list

    This is a simple unordered list, we need to remowe bullets and make it horizontal.
    <ul class="tags">
        <li class="tag">
            <a target="_blank" href="#">css</a>
        </li>
        <li class="tag">
            <a target="_blank" href="#">html</a>
        </li>
        <li class="tag">
            <a target="_blank" href="#">python</a>
        </li>
        <li class="tag">
            <a target="_blank" href="#">Demo</a>
        </li>
    </ul>

    And here we have the css
    ul .tags {
        list-style: none;
    }
    .tags a, .tags a:visited, .tags a:active{
        color: #ddd;
        border:1px solid #ddd;
        border-radius:5px;
        text-decoration:none;
        padding:3px;
        margin:3px;
        text-transform:uppercase;
        font-size: 1em;
        line-height: 1.2em;
    }
    .tags a::before{
        content:'#';
    }
        
    .tags a:hover {
        color: #fff;
        background:#eee;
    }
    
    li.tag {
        display: inline;
        list-style-type: none;
    }
    

    Perhaps I'll change the layout of the labels in this site to.

    --cheers