如何在css中标记面板主体中的面板链接

时间:2016-09-18 05:15:40

标签: php html css wordpress

问题是我有一个没有头部的面板,而博客文章就在身体内部。我已成功将代码添加到正文以影响链接的文本修饰,但无法在css中找到标记。

<div class = "panel panel-default panel-body">
  <article class = "post">
    <h2><a href = "<?php the_permalink(); ?>" style="text-decoration: none"><?php the_title(); ?></a></h2>
    <?php the_content(); ?>
  </article>
</div>

提前致谢 史蒂芬

1 个答案:

答案 0 :(得分:0)

您可以使用一些 CSS组合器

.post h2 a {
    text-decoration: none;
}

这将选择a标记内的所有h2标记,这些标记是post类元素的子级。