gpt4 book ai didi

php - Wordpress 更改主题中内联的 css 值

转载 作者:行者123 更新时间:2023-11-27 23:55:36 26 4
gpt4 key购买 nike

我正在使用这个 wordpress theme我需要更改主页上 div 类中的值。这个 div 类是

<div class="vertical-center">

还有内联值

style="padding-top: 132px;

我试图找到这个值的设置在哪里

  • 使用文本编辑器搜索文件(.js、.css、.php):无
  • 管理员中的主题选项设置:无
  • 进入mysql数据库:无

并且这个值没有出现在源页面中,但是你可以用检查器看到它(使用 chrome)

这个值在哪里,如何改变???谢谢

最佳答案

padding-top 样式正在被您的事件主题文件夹中的 /javascripts/main.js 中的某些 JavaScript 应用(尊严)。

应用此样式的行是:

 //Vertical Centering of natural content spcific elements (non-images)
$(function ($) {
/*if your element is an image then please use $(window).load() instead tha above function wrap, because we want the coding to take
effect when the image is loaded. */

//get the width of the parent
var parent_height = $('.vertical-center').parent().height();
var image_height = $('.vertical-center').height();

var top_margin = (parent_height - image_height)/2;

//center it
$('.vertical-center').css( 'padding-top' , top_margin);
//uncomment the following if ithe element to be centered is an image
$('.vertical-center-img').css( 'margin-top' , top_margin);
});

如果你想删除它,一种选择是通过使用 CSS:

.vertical-center {
padding-top: 0 !important;
}

.vertical-center-img {
margin-top: 0 !important;
}

通过使用 !important,您将覆盖内联样式。

确保您在子主题或适当的区域中执行此操作以添加自定义 CSS,以避免在更新主题时它被覆盖。

关于php - Wordpress 更改主题中内联的 css 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24140481/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com