Reputation:
I want to make the images on this page centre aligned. I have tried below solution but it does not work in my case. Please guide. PASSWORD: inspurate123
Solution:
display: block;
margin-left: auto;
margin-right: auto;
My code:
<div class="title_area" style="float:left;">
<h1 class="post_title">
<a href="<?php the_permalink();?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h1>
<br>
<?php the_content(); ?>
</div>
</article>
<?php get_template_part('share_this');?>
</div>
Upvotes: 0
Views: 70
Reputation:
Try this and let me know if it worked
img{
display:block !important;
clear:both;
margin:0 auto;
}
Upvotes: 0
Reputation: 7122
Try it:-
.wp-caption.alignnone{
margin:0 auto
}
.title_area img {
display: block;
margin: 0 auto;
width: 90%;
}
Hope it works for you.
Upvotes: 1
Reputation: 2157
First of all remove float
you can do it like below
Fiddle
img{
margin:0 auto;
}
.imageReplace{
text-align:center
}
Html
<div class="imageReplace">
<img src="http://drublic.de/blog/wp-content/uploads/2011/10/rotate-images.jpg">
</div>
Upvotes: 0
Reputation: 568
You can use display:inline-flex (CSS3)
add this to the body{display:inline-flex; width:100%;}
now remove the padding from your login.
It's css3, some browsers won't support it.
Upvotes: 0
Reputation: 6219
Try this
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Upvotes: 0