html - 使图像居中对齐

标签 html css

我想在 this 上制作图像页面居中对齐。我尝试了以下解决方案,但在我的情况下不起作用。请指导。 密码:inspurate123

解决方案:

display: block;
margin-left: auto;
margin-right: auto; 

我的代码:

<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>

最佳答案

enter image description here

试一试:-

.wp-caption.alignnone{
     margin:0 auto
 }
.title_area img {
    display: block;
    margin: 0 auto;
    width: 90%;
}

希望它对你有用。

enter image description here

关于html - 使图像居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26424007/

相关文章:

javascript - jQuery 不隐藏 div 但 DOM 已加载

html - css 图像背景位置动态

jquery - django bootstrap 下拉菜单不工作

php - Magento 中的销售产品 block 消失了

css - 动画菜单和 Cufon 字体大小

html - 当我有分层背景时,如何在内容周围创建填充?

javascript - 如何用JavaScript清除网站的缓存?

css - 使用 :before on an element it becomes the first child of said element? 时

javascript - 通过 HTML/CSS/JavaScript 实现 5 种可能的颜色?

javascript - 在边框不反射(reflect)的 css 中构建骨架屏幕