【问题标题】:How do i change <article> php element style我如何更改 <article> php 元素样式
【发布时间】:2018-11-15 17:50:08
【问题描述】:

我正在尝试基于 wordpress 模板建立自己的网站。有一个主要问题:文章在 html 中设置了它自己的元素样式,我在 style.css 或任何其他文件中找不到它 这就是我得到的:

<article id="post-26" class="post-item post-26 post type-post status-publish format-standard has-post-thumbnail hentry category-uncategorized" style="position: absolute; left: 0px; top: 0px;">

这是我的存档.php:

<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>

如何删除绝对位置?

【问题讨论】:

  • article.post { position: static; } 应该删除它的绝对定位。如果没有,只需将!important 添加到规则中即可。

标签: html css


【解决方案1】:

如果只是几页的问题,我会使用 JavaScript 解决 WordPress 中的设计问题(当 custom style.css 不够时)。

编辑绝对&lt;article&gt; 来自仪表板的页面/帖子(.../wp-admin)。切换到“文本”视图(不是“视觉”)。在文本框中任何文本的末尾插入以下代码。

<script>
document.getElementById('post-26').style.position = null;
</script>

这里我们只是使用它的 ID 和position 中的removing the style 来选择元素。

Here is a picture of all this

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-09
    • 2021-03-15
    • 1970-01-01
    • 2017-04-06
    • 1970-01-01
    • 2016-02-15
    相关资源
    最近更新 更多