我正在使用这个wordpress theme我需要更改主页上 div 类中的值。 这个div类是
<div class="vertical-center">
还有内联值
style="padding-top: 132px;
我试图找到这个值的设置在哪里
- 使用文本编辑器搜索文件(.js、.css、.php):无
- 管理中的主题选项设置:无
- 进入 mysql 数据库:无
并且这个值不会出现在源页面中,但是您可以使用检查器(使用chrome)看到它
这个值在哪里以及如何更改它??? 谢谢
最佳答案
padding-top 样式由事件主题文件夹中 /javascripts/main.js
内的一些 JavaScript 应用(dignity)。
应用此样式的行是:
//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/