Reputation: 167
What is the correct way to position something? I have a div that displays blog posts in the centre.
<div class="box">
<?php while ( have_posts() ) : the_post(); ?>
<article>
<h2><a href="<?php esc_url( the_permalink() ); ?>"<?php the_title(); ?>" rel="bookmark"> <?php the_title(); ?></a></h2>
<h7>BY LOUIS MOORE ON</h7> <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?> <?php the_time(); ?></time><?php the_content(); ?></br>
<div class="h9"></div>
</article></br></br></br>
<?php endwhile; ?>
</div>
CSS:
.box {
text-align: center;
background-color: #F1F2F2;
border: 1.5px #D1D3D4 solid;
border-bottom: 3px solid red;
margin: 5px;
padding: 10px;
min-width: 90%;
}
I want to add 'Follow Me On Twitter', followed by a Twitter button, but I want this to be displayed on the right hand side of the div box. What is the correct way to do this?
Upvotes: 0
Views: 70
Reputation: 8029
float: right;
would work if you would want it within the same bounds, if you wanted it outside the box you could create a container to store them both in.
<div class="container">
<div class="box">...</div>
<a href="#">Follow me on Twitter</a>
</div>
.contianer a {
float: right;
}
Upvotes: 0