我无法修改集成的WordPress代码的CSS

时间:2016-09-17 21:47:53

标签: html css wordpress

我有一个静态网页,我用作我的主页。我正在使用HTML和CSS代码设计页面,并在My WordPress中集成了一些PHP代码。 最后一个集成代码是显示最近3个帖子的代码。它显示帖子,但我不能用CSS修改结果。这是PHP代码:

In [1]: df = pd.pivot_table(df, index='Date', columns='FieldA', values=['ValueA', 'ValueB'])

In [2]: df.columns = [ '{}_{}'.format(cat, val) for val, cat in df.columns ]

In [3]: df
Out[3]: 
            TypeA_ValueA  TypeB_ValueA  TypeA_ValueB  TypeB_ValueB
Date                                                              
09-02-2016             3             6             5             7

我已尝试过CSS中的所有内容,命名<?php $args=array('numberposts'=>3,'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date"); $postslist = get_posts( $args ); echo '<ul class="latest_posts">'; foreach ($postslist as $post) : setup_postdata($post); ?> <li> <?php the_post_thumbnail('medium'); ?><br/> <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"> <?php the_title(); ?></a> </li> <?php endforeach; ?> </ul> ,命名div,甚至在CSS中使用span并且没有任何反应。它保持原样。

2 个答案:

答案 0 :(得分:1)

如果您的css规则编码正确,则不需要

important。最后的规则应该覆盖任何以前的规则。确保您定位的是正确的元素,并将要应用的规则放在css代码的最后。

答案 1 :(得分:-1)

在自定义css文件中使用此功能

   ul.latest_posts{
    list-style: none !important;
    }