如何改变li class bg颜色

时间:2014-08-28 09:13:26

标签: php css

我如何为这个li类添加背景? 我想将代码添加到蓝色代码中。 我需要添加什么

我需要添加的地方?

tnx!

<li class="tribe-events-list-widget-events <?php tribe_events_event_classes() ?>">

    <?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?>
    <!-- Event Title -->
    <h2 class="entry-title summary">
        <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
    </h2>

    <?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?> 
    <!-- Event Time -->

    <?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?>

    <div class="duration">
        <?php echo tribe_events_event_schedule_details(); ?>
    </div>

    <?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?>
</li>

2 个答案:

答案 0 :(得分:2)

的CSS:

li.tribe-events-list-widget-events {

background-color: blue;

}

答案 1 :(得分:0)

You are using this code have you checked your function return the class "<?php tribe_events_event_classes() ?>". If yes then try this code:-

&#34;&GT;

<?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?>
<!-- Event Title -->
<h2 class="entry-title summary">
    <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>

<?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?> 
<!-- Event Time -->

<?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?>

<div class="duration">
    <?php echo tribe_events_event_schedule_details(); ?>
</div>

<?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?>