dozxos6346 2016-09-18 05:15
浏览 16
已采纳

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

the thing is that I have a panel with no head and the blog post inside just the body. I have successfully added the code to the body to affect the text decoration of the link, but cannot find the tag to do it in css alone.

<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>

Thanks in advance Steven

  • 写回答

1条回答 默认 最新

  • douhuan1905 2016-09-18 05:28
    关注

    You can use some CSS combinators:

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

    This will select all a tags inside h2 tags that are childrens of an element with post class.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?