如何使用CSS在Avada WordPress主题中使H1标签响应



我的朋友正在使用Avada WordPress主题,目前已经升级了最新版本的WordPress(通过管理面板,我认为没有上传任何物理文件)。

他的页面标题(H1)不再像升级前那样具有响应性。调整浏览器大小时,标题保持页面的全宽。

标题是这样放置在页面顶部的(在管理员中):

[fullwidth backgroundcolor="no" backgroundimage="" backgroundrepeat="no-repeat" backgroundposition="left top" backgroundattachment="scroll" bordersize="0px" bordercolor="" borderstyle="solid" paddingtop="0px" paddingbottom="0px" paddingleft="0px" paddingright="0px" menu_anchor="" class="big_title" id=""][four_fifth last="no" class="" id=""][title size="1" content_align="left" style_type="single" sep_color="#ffffff" class="" id=""]H1 PAGE TITLE HERE[/title][/four_fifth][one_fifth last="yes" class="" id=""][button link="http://www.arttouchesart.com/about/" color="custom" size="medium" type="flat" shape="square" target="_self" title="" gradient_colors="#ffffff|#ffffff" gradient_hover_colors="#000000|#000000" accent_color="#000000" accent_hover_color="#ffffff" bevel_color="" border_width="2px" shadow="no" icon="" icon_position="left" icon_divider="no" modal="" animation_type="0" animation_direction="left" animation_speed="1" alignment="right" class="" id=""]ABOUT[/button][/one_fifth]

我在CSS中找到了big_title类,它位于custom.CSS文件中:

.big_title h1 {
font-size:56px;
line-height:56px;
text-align:left!important;
}

有没有一个简单的CSS技巧可以让H1在浏览器变小后重新调整大小?

如果不看样式的其余部分,很难说出如何巧妙地完成这项工作。但是,你可以试试:

.big_title h1 {
    /* All your other CSS here */
    max-width: 100% !important;
}

注意-我添加了!important声明,只是作为一个故障保护。先测试它,如果它有效,就不要包含它。如果它不起作用,添加它,看看是否有帮助。

如果仍然没有乐趣,你需要右键点击h1标签(在你的网络浏览器中),然后点击"检查"(假设你使用的是谷歌浏览器,IE、Firefox和Safari中也会有类似的功能)。然后,您需要使用元素检查器来查看应用于该标记的CSS属性,并找出如何在custom.CSS文件中覆盖它们(就像我们刚刚尝试的那样)。

最新更新