【问题标题】:css not working at tag cloudCSS在标签云上不起作用
【发布时间】:2014-05-02 19:28:56
【问题描述】:

我用过一个jQuery标签云插件:http://johannburkard.de/blog/programming/javascript/dynacloud-a-dynamic-javascript-tag-keyword-cloud-with-jquery.html

在它上面,我正在尝试用 CSS 突出显示一些标签。但是,不幸的是,我编写的 CSS 不会影响任何标签。我的一些 HTML 代码:

<div id="dynacloud">
    <div id="text" class="dynacloud">
        <a href="#Create"><span>Create</span></a>
        <a href="#Edit"><span>Edit</span></a>
        <a href="#Modify" class="highlight"><span>Modify</span></a>
        <a href="#Movie"><span class="highlight">Movie</span></a>
        <a href="#Song"><span>Song</span></a>
    </div>
</div>

一些 CSS:

.highlight {
    color:#333 !important;
    font-weight:800 !important;
    font-size:1.9em !important;
}

我在 HTML 代码中定义了类名“highlight”。但是,在通过浏览器检查元素查看后,我发现我在 HTML 代码上定义的“突出显示”类不再存在。我不明白为什么会这样。如何使我的一些标签突出显示?

我的工作:http://jsfiddle.net/learner73/LJcBB/

【问题讨论】:

    标签: jquery css tags tag-cloud


    【解决方案1】:

    Dynacloud 使用没有 ID 的类

    演示http://jsfiddle.net/LJcBB/2/

    <div class="dynacloud">
    

    CSS

    .dynacloud{
        margin-bottom: 20px;
        margin-left: 16px;
        text-align: center;
        line-height: 30px;
        word-spacing: 5px;
    }
    .dynacloud a{
        color: #999999;
        font-size: 1.6em !important;    
        font-weight: 100;
        text-decoration: none;
    }
    .dynacloud a:hover{
        color:#333;
        text-decoration:underline;  
    }
    .highlight {
        color:#333 !important;
        font-weight:800 !important;
        font-size:1.9em !important;
    }
    

    【讨论】:

    • 有一件事,如果我不使用 id,它就不会按字母顺序排序。我怎样才能使这个按字母顺序排序:jsfiddle.net/learner73/LJcBB
    猜你喜欢
    • 2014-11-21
    • 1970-01-01
    • 1970-01-01
    • 2012-02-28
    • 2018-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-18
    相关资源
    最近更新 更多