我有以下 css,边距根本不起作用。这是一个 link对于实时站点,请记住它是在移动开发中,所以这就是它看起来很有趣的原因。不动的元素是推文旁边的 austin kitson
CSS
i{
font-size:0.6em;
margin-top:-5px;
margin-left: -25px;
position:relative;
padding-bottom:10px;
}
html
<section class="blogPostsSection">
<header class="blogPostsHeader">
<?php edit_post_link('edit', '<p>', '</p>'); ?>
<h2><?php the_date(); ?></h2>
<h3><?php the_title(); ?></h3>
</header>
<?php $image = wp_get_attachment_image_src(get_field('add_images_here'), 'large');?>
<?php if( $image !=false ) {?>
<img src="<?php echo $image[0]; ?>" alt="<?php get_the_title(get_field('add_images_here')) ?>" />
<?php } ?>
<p>
<?php the_content(); ?>
</p>
<a href="https://twitter.com/share" class="twitter-share-button"
data-text="<?php the_title(); ?>" data-via="twitterapi" data-lang="en">Tweet</a>
<script>
!function(d,s,id){ var js,fjs=d.getElementsByTagName(s)[0];
if(!d.getElementById(id)){
js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}
(document,"script","twitter-wjs");
</script>
<a href="http://austin.kitson.org"><i>Austin Kitson</i></a>
</section>
最佳答案
您没有包含您的 CSS:您所有的 CSS 和 JS 都引用 localhost
。例如,http://localhost/~anderskitson/techbasics/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=3.3.3
关于css - margin-top 不移动 i 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14916751/