说我有这样的布局:
<div id="main">
<div id="NormalContent">
{some content which is a fixed length list}
</div>
<div id="FeaturedContent">
{some content which may contain a long list}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我想将FeaturedContent放在NormalContent之上.
我可以用CSS做到这一点吗?我想我可以使用Javascript吗?
所以我有这个HTML代码与以下CSS.
HTML
<div class="secondpostholder">
<div class="rightsecond">
<h1>
<a href="<?php the_permalink();?>" alt="<?php the_title();?>" title="<?php the_title();?>">
<?php the_title();?>
</a>
</h1>
<div class="firstmetaholder">
<p class="secondentrymeta">
by
<span class="secondauthormeta">
<?php the_author();?>
</span>
• <?php the_date(); ?>
</p>
<p class="secondentryexcerpt">
<?php
$content = get_the_content();
echo wp_trim_words( $content , '30' ); ?>
</p>
<div class="secondreadmoreholder">
<a class="secondreadmorea" href="<?php the_permalink();?>" alt="<?php the_title();?>" title="<?php the_title();?>">
Read More
</a>
</div>
</div>
</div>
<?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'TypeOne' ); ?>
<div class="leftsecond" style="background-image: url('<?php echo $background[0]; ?>');"> …Run Code Online (Sandbox Code Playgroud)