1

Below is my html code that I want to add in one of the CMS block.

<ul class="header-social">
<li><a href="{{store url=''}}"><span class="fa fa-facebook"></span></a></li>
<li><a href="{{store url=''}}"><span class="fa fa-twitter"></span></a></li>
<li><a href="{{store url=''}}"><span class="fa fa-google-plus "></span></a></li>
</ul>  

When I saved above code in static block, it will remove span from above html content and it just display like below

<li></li>
<li></li>
<li></li>

Is there any solution for it?

2 Answers 2

2

Please try the below code

<ul class="header-social">
<li><a href="{{store url=''}}"><span class="fa fa-facebook"><em class="hidden">hidden</em></span></a></li>
<li><a href="{{store url=''}}"><span class="fa fa-twitter"><em class="hidden">hidden</em></span></a></li>
<li><a href="{{store url=''}}"><span class="fa fa-google-plus "><em class="hidden">hidden</em></span></a></li>
</ul>

Add this css

.hidden {
    display: block!important;
    border: 0!important;
    margin: 0!important;
    padding: 0!important;
    font-size: 0!important;
    line-height: 0!important;
    width: 0!important;
    height: 0!important;
    overflow: hidden!important;
}
0

by default magento's editor will remove all empty elements, so for your case both span & anchor tags are empty, the solution is to add   if you do not want to have any text, e.g.

<li><a href="{{store url=''}}"><span class="fa fa-facebook">&nbsp;</span></a></li>

I tried and working fine for me, please upvote if problem resolved for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.