html - 我如何更改 <article> php 元素样式

标签 html css

我正在尝试基于 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;">

这是我的 archive.php:

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

如何删除绝对位置?

最佳答案

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

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

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

这里我们只是使用它的 ID 选择元素,removing the styleposition .

Here is a picture of all this

关于html - 我如何更改 <article> php 元素样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53325258/

相关文章:

c# - 在 web.config 值中使用 HTML 下标

javascript - 如何在 JavaScript 小部件中正确生成 HTML?

html - 为什么不工作

html - 在 IE 的 CSS 菜单中居中 LI 元素?

html - Polymer:将样式应用于 Shadow DOM 下的元素

php - 如何在 <li> 中将 Bootstrap 徽章与 AJAX 对齐

JavaScript自动将图像文件保存到文件夹

html - Bootstrap 导航问题 - 响应问题

html - 非常基本的 HTML 页面不会显示

html - 导航菜单问题