Title: Align Center code
Last modified: August 19, 2016

---

# Align Center code

 *  [Rick Patterson](https://wordpress.org/support/users/rick-patterson/)
 * (@rick-patterson)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/)
 * I wish to have the option to align center..
 * is there a code to change the align right to align **center**?
 * here is the code…
 * // Float Mode if (( $atts[‘float’] === ‘true’ ) && in_array($atts[‘align’], array(‘
   left’, ‘right’)) ) {$floatStart = “<div style=’float:{$atts[‘align’]}; width:{
   $atts[‘width’]}px;’ >”;
    $floatEnd = ‘</div>’;}
 * ______________________________________________________
 * Thank you for considering my inquery.

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

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363307)
 * well…. that code appears to be setting an inline css style of float:right
 * the css equivalent for centering something is margins usually..
 * margin: 0 auto;
 * how to translate it to that code…I’m not sure
 *  [hellomatt](https://wordpress.org/support/users/hellomatt/)
 * (@hellomatt)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363308)
 * I think that code is for the div to either float left or right. You cannot float
   a div center. Additionally, div “align:center” won’t work either.
 * To center a div you would can change positioning via the margins, or other methods.
 * Can you post a link to your site and explain what you are looking to customize?
 *  Thread Starter [Rick Patterson](https://wordpress.org/support/users/rick-patterson/)
 * (@rick-patterson)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363348)
 * Yes, thank you Hellomat for responding…
 * [http://thehandymantoolbox.com/discover-d-i-y/](http://thehandymantoolbox.com/discover-d-i-y/)
 * goto the bottom, look for the gold box …”Give me free access now” button.
 *  Thread Starter [Rick Patterson](https://wordpress.org/support/users/rick-patterson/)
 * (@rick-patterson)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363350)
 * BTW…this is a wp-special-textboxes plugin….
 *  [hellomatt](https://wordpress.org/support/users/hellomatt/)
 * (@hellomatt)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363353)
 * In your css, you can try adding:
 * .stb-custom_box{
    margin:0 auto;}
 *  Thread Starter [Rick Patterson](https://wordpress.org/support/users/rick-patterson/)
 * (@rick-patterson)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363367)
 * nope…did not change anything…
 * any other ideas?

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

The topic ‘Align Center code’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Rick Patterson](https://wordpress.org/support/users/rick-patterson/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/align-center-code/#post-1363367)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
