Title: Centering an image / Float
Last modified: August 20, 2016

---

# Centering an image / Float

 *  [alessandro.scoccia.pappagallo](https://wordpress.org/support/users/alessandroscocciapappagallo/)
 * (@alessandroscocciapappagallo)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/)
 * Hello, sorry to bother you with a silly question. I’ve starting working with 
   programming and WordPress from just a couple of weeks.
 * My problem today is that I have a log shifted to the left and I would like to
   have it centered. Unfortunately float doesn’t have this option.
 * The code is;
 *     ```
       /* 2.3 Header */
       #header{padding:30px 0 30px;clear:both;position:relative;}
   
       #logo  { float: left; }
       #logo img  { }
       #logo .site-title, #logo .site-description  { color: #000; display:none;  }
       #logo .site-title a { color:#222; font-size:40px; line-height:40px; text-transform:none; font-weight:bold; text-decoration:none; }
       #logo .site-title a:hover { text-decoration:underline; }
       #logo .site-description { color:#999; }
       ```
   
 * Any idea what could I use for centering the logo (without giving the size of 
   the logo itself?). I already tried with “margin-left: auto; margin-right: auto;”
   but unfortunately it doesn’t work. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [jnhghy](https://wordpress.org/support/users/jnhghy/)
 * (@jnhghy)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/#post-2912074)
 * Hi,
    you need to have an upper level <div> set to have `text-align: center;` 
   to have it’s [content centered](http://www.w3schools.com/cssref/pr_text_text-align.asp)…
   if you can share you site address it will help us give you more specific guidance.
   Regards
 *  Thread Starter [alessandro.scoccia.pappagallo](https://wordpress.org/support/users/alessandroscocciapappagallo/)
 * (@alessandroscocciapappagallo)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/#post-2912094)
 * I have no idea how to do that. 😀 By the way this is the website: [http://www.youthunitedpress.com](http://www.youthunitedpress.com)(
   I didn’t post it before because I didn’t want to do spam!). Thank you in advance
   jnhghy! 🙂
 *  [jnhghy](https://wordpress.org/support/users/jnhghy/)
 * (@jnhghy)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/#post-2912103)
 * ok, where can I see your logo?
 *  [Sugar Apple](https://wordpress.org/support/users/blacklizt/)
 * (@blacklizt)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/#post-2912104)
 * your site is under maintenance mode.
 * note: if it’s about design problems, you better share the site link and it will
   not marked as spam (usually, most of them).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Centering an image / Float’ is closed to new replies.

## Tags

 * [centering](https://wordpress.org/support/topic-tag/centering/)
 * [float](https://wordpress.org/support/topic-tag/float/)
 * [logo](https://wordpress.org/support/topic-tag/logo/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [Sugar Apple](https://wordpress.org/support/users/blacklizt/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/centering-an-image-float/#post-2912104)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
