【问题标题】:How can I set a css property to tags with specific attribute?如何将 css 属性设置为具有特定属性的标签?
【发布时间】:2016-01-02 17:10:26
【问题描述】:

我想使用 stylebot 之类的扩展名更改 Inbox.google.com 的字体,但我只想更改带有属性的标签中的字体:dir="rtl",如下所示:

<div dir="rtl">سلام به همگی</div>

它只会更改 rtl 语言文本的字体,我知道 jquery 可以做到这一点,但我不知道如何使用 css 或任何扩展来执行此操作,以便在其他网页上运行 jquery。

感谢您的帮助

【问题讨论】:

    标签: jquery css google-chrome google-chrome-extension


    【解决方案1】:

    对 CSS 使用 Attribute Selector

    div[dir="rtl"] {
      font-family: "Your Font";
    }
    

    【讨论】:

    • 我对属性选择器一无所知!太棒了!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-02
    • 2019-06-03
    • 1970-01-01
    • 2011-04-16
    相关资源
    最近更新 更多