【问题标题】:Reducing font size on one page减小一页上的字体大小
【发布时间】:2015-01-16 16:24:04
【问题描述】:

我的网站上有一个块(我使用 Drupal),该块显示在 主页和推荐页面上。

由于我增加了块的字体大小,它现在在主页上看起来很棒,但在推荐页面上就不那么好了!

首页:http://www.workbooks.com 推荐页面:http://workbooks.com/testimonials

有问题的文字如下:

See how Workbooks #1 rated web based CRM software can help your organisation to increase revenue, streamline businesses processes and reduce costs.
Workbooks extends beyond traditional CRM to include sales order processing, contract management and invoicing, so you can manage all your customer 

现在我可以轻松更改字体大小,但是因为它在主页上非常理想我只想在推荐页面上显示内容类型时才减小字体大小(/testimonials)这可能吗?

【问题讨论】:

  • 是的,是可能的。只需给一个类环绕推荐,然后你就可以有这样的: .testimonials .yourclass[ /*your rules*/]

标签: html css drupal drupal-7


【解决方案1】:

只需添加这个 CSS

.section-testimonials .field-content p{
font-size: 11px;
line-height: 14px !important;
margin-top: 4px;
}

注意:当心你有一个 css inline 在那个 p - font-size: 15px;最好删除。

【讨论】:

    【解决方案2】:

    由于您有一个具有页面特定类(.page-testimonials)的body标签,

    <body class="html not-front not-logged-in no-sidebars page-testimonials section-testimonials page-views container" >
    

    你可以把它放在网站的主 CSS 中:

    .page-testimonials .row-first .col-first .field-content p {
    font-size: 12px !important;}
    

    另一种解决方案是编辑框的内容,所以如果写&lt;p style="font-size: 15px;"&gt;,你写&lt;p class="testimonials-box"&gt;

    然后你可以将它添加到你的主css中,只针对首页的字体大小,而让其他地方使用默认字体大小。

    .front p.testimonials-box {font-size:15px;}
    

    您使用 .front 来定位首页(即现在代码中的一个 css 类)。

    【讨论】:

      【解决方案3】:

      在 drupal 中,每个显示的内容类型都在向 body 元素添加一些 CSS 类。此外,页面上的每个块都有一些类(和/或 id)。因此,通过结合这 2 个,您可以将任何块对准任何页面。

      【讨论】:

        猜你喜欢
        • 2021-04-20
        • 2011-12-17
        • 1970-01-01
        • 2021-03-27
        • 2016-09-18
        • 1970-01-01
        • 2011-02-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多