忽略内联块的社会图标

时间:2017-01-23 17:02:40

标签: html css wordpress

我创建了三个社交图标,在一行中彼此相邻(请参阅我的工作JSFiddle - here)。

然而,当我把它们放在我的Wordpress博客上时,不是并排坐在一起,而是看到 - https://www.moneynest.co.uk/testing-social-icons/

如何让我的Wordpress版本模仿我的JSFiddle版本?

HTML

<div data-sumome-share="Facebook" data-sumome-share-text="Great article by the Money Nest team." class="social-icons" id="facebook_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/facebook-white.png" height="20px" class="social-image-align" >share<span data-sumome-share-count="share"></span></div><!--
--><div data-sumome-share="Twitter" data-sumome-share-text="Great article, check it out..." class="social-icons" id="twitter_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/twitter-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div><!--
--><div data-sumome-share="Linkedin" data-sumome-share-text="Great article, check it out..." class="social-icons" id="linkedin_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/linkedin-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div>

CSS

social-image-align {
  position: relative;
  top: -1px;
height: 20px;
  margin-right: 8px;
}

#facebook_icon {
      background-color: #3B5997;
}

#facebook_icon:hover {
  background-color: #4264a9;
}

#twitter_icon {
      background-color: #1bb2e9;
}

#twitter_icon:hover {
  background-color: #32baeb;
  }

#linkedin_icon {
      background-color: #008cd0;
}

#linkedin_icon:hover {
  background-color: #007bb6;
}

.social-icons {
    padding: 8px 5px;
    text-align: center;
    width: 30%;
    display: inline-block;
    color: white;
    text-transform: uppercase;
}

1 个答案:

答案 0 :(得分:1)

WordPress似乎在<div>

之间添加了一些段落标记

如果您无法将其删除,请将display设置为none

.entry-content p{
	display: none;
}

.social-icons {
    padding: 8px 5px;
    text-align: center;
    width: 30%;
    display: inline-block;
    text-transform: uppercase;
}
<div class="entry-content">
	<div data-sumome-share="Facebook" data-sumome-share-text="Great article by the Money Nest team." class="social-icons" id="facebook_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/facebook-white.png" height="20px" class="social-image-align" >share<span data-sumome-share-count="share"></span></div><p><!--
	--></p><div data-sumome-share="Twitter" data-sumome-share-text="Great article, check it out..." class="social-icons" id="twitter_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/twitter-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div><p><!--
	--></p><div data-sumome-share="Linkedin" data-sumome-share-text="Great article, check it out..." class="social-icons" id="linkedin_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/linkedin-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div>
</div>