简体   繁体   中英

Styling the comments of a post on WP

I can't stylize the elements that only show on the page when it has comments ( <comments> , <commentlist> etc) with the CSS file. I got it to work like

<?php here it calls the comments if any ?>
<style>
 .comments{}
</style>

I would like to know why this happens and if there is any better way to deal with this. Thanks

Derik

There is no need to dynamically add CSS by PHP.

If you are not using the header(“Content-type: text/css”); before output, then CSS, which has been dynamically produced, will slow down your page. It will behave as internal CSS, therefore the better solution is to cache it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM