Center PHP Divi Wordpress footer code

0

Hi, I have the following code, I'm working with Wordpress and the constructor called DIVI Builder in addition to the theme or template called DIVI, I have not managed to center the icons even with a DIV.

<div align="center">
   <img src="http://logo.png" alt="Facebook"><br>
</div>

<ul class="et-social-icons">
   <?php if ( 'on' === et_get_option( 'divi_show_facebook_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-facebook">
      <img src="http://Facebook.png" alt="Facebook">
      <span><?php esc_html_e( 'Facebook', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
   <?php if ( 'on' === et_get_option( 'divi_show_instagram_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-twitter">
      <img src="http://Instagram.png" alt="Instagram">  
      <span><?php esc_html_e( 'Twitter', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
   <?php if ( 'on' === et_get_option( 'divi_show_twitter_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-twitter">
      <img src="http://Twitter.png" alt="Twitter">
      <span><?php esc_html_e( 'Twitter', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
</ul>

The logo of the company if it is centered, I just need to center the icons of social networks, because I focus on the pass to responsive

Any suggestions?

    
asked by H14rmy 21.01.2017 в 15:37
source

2 answers

1

Without seeing better your code is impossible but why not put a div encompassing the ul with the center class?

<div align="center">
   <img src="http://logo.png" alt="Facebook"><br>
</div>

<div class="div_centrado">
<ul class="et-social-icons">
   <?php if ( 'on' === et_get_option( 'divi_show_facebook_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-facebook">
      <img src="http://Facebook.png" alt="Facebook">
      <span><?php esc_html_e( 'Facebook', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
   <?php if ( 'on' === et_get_option( 'divi_show_instagram_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-twitter">
      <img src="http://Instagram.png" alt="Instagram">  
      <span><?php esc_html_e( 'Twitter', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
   <?php if ( 'on' === et_get_option( 'divi_show_twitter_icon', 'on' ) ) : ?>
   <li class="et-social-icon et-social-twitter">
      <img src="http://Twitter.png" alt="Twitter">
      <span><?php esc_html_e( 'Twitter', 'Divi' ); ?></span>
      </a>
   </li>
   <?php endif; ?>
</ul>
</div>

And now in CSS, put whatever you need to your class div_centrado so that it comes out in the position you need.

.div_centrado{
/*Es un ejemplo*/
text-align: center;
padding:25px
}
    
answered by 21.01.2017 в 17:50
1

Add a DIV out of ul as follows:

<div align="center">
    <ul class="et-social-icons">
        ...
    </u>
</div>
    
answered by 26.03.2017 в 11:12