Title: Div and alignment
Last modified: August 20, 2016

---

# Div and alignment

 *  Resolved [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * (@danielwoodhead)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/)
 * Not sure if this is just me not understanding not coding correctly, but in anyone
   can help let me know.
 * I have created the following divs in the css file
 *     ```
       #div_split{
       clear.both;
       }
       .sub_lefthalf{
       	width: 50%;
       	float: Left;
       }
   
       .sub_righthalf{
       	width: 50%;
       	float: Right;
       }
       #div_center{
       clear.both;
       }
       .sub_centre{
       	width: 100%;
       	float: center;
       }
   
       #div_3Split{
       clear.both;
       }
   
       .sub_1{
       	width: 30%;
       	float: Left;
       }
   
       .sub_2{
       	width: 30%;
       	float: Center;
       }
       .sub_3{
       	width: 30%;
       	float: Right;
       }
   
       and the following on a wordpress page.
   
       <div id="div_split">
       <div class="sub_lefthalf" style="text-align: center;">
       ...</div>
       <div class="sub_righthalf" style="text-align: center;">
       ...</div>
       </div>
       <div id="div_center">
       <div id="sub_centre" style="text-align: center;">
       ...</div>
       </div>
       <div id="div_3Split">
       <div class="sub_1" style="text-align: center;">
       ...</div>
       <div class="sub_2" style="text-align: center;">
       ...
       </div>
       <div class="sub_3" style="text-align: center;">
       ...</div>
       </div>
       ```
   
 * _
    ** [Please use the code buttons when posting code here.]**
 * The problem I’m having is that the div_3split is supposed to show 3 columns next
   to each other, but it shows sub1 ok, then sub 2 is underneath the sub1 and is
   aligned to the left when it chould be center. Then sub3 is under sub2 ,but this
   is aligned to the right as if should be.
 * If anyone can help me out or point me in the right direction.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494935)
 * a css forum might be a better place to ask; for instance [http://csscreator.com/forum](http://csscreator.com/forum)
 *  Thread Starter [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * (@danielwoodhead)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494940)
 * I think the issue is with wordpress as if I put the code into just a html file
   it works as expected.
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494943)
 * Without a link to a live page where this code is not working, there’s no way 
   to help with CSS issues.
 * Also, make sure your code is error free:
 * [http://codex.wordpress.org/Validating_a_Website](http://codex.wordpress.org/Validating_a_Website)
 *  Thread Starter [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * (@danielwoodhead)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494947)
 * The live page is
 * [http://www.cawoodcc.co.uk/?page_id=13](http://www.cawoodcc.co.uk/?page_id=13)
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494949)
 * Check that CSS:
    [http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.cawoodcc.co.uk%2F%3Fpage_id%3D13&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en](http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.cawoodcc.co.uk%2F%3Fpage_id%3D13&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en)
 * Good reference if you need it:
 * [http://www.w3schools.com/css/](http://www.w3schools.com/css/)
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494950)
 * One other thing you should be aware of is that if you make any changes to theme
   files (i.e. CSS style.css file), those changes will be overwritten when the theme
   or WP (for default themes like yours) is updated. It’s therefore highly recommended
   that you create a Child Theme or use a custom CSS plugin such as JetPack.
 * [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494957)
 * the issue is basic css – for instance [http://www.w3schools.com/css/css_float.asp](http://www.w3schools.com/css/css_float.asp)
 * this forum is not the space to teach fundamental knowledge of formatting.
 *  Thread Starter [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * (@danielwoodhead)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494958)
 * Thanks for the info guys. Only do css once in a blue moon and can’t remember 
   how I did it last time. Will do a bit more reading up.
 *  Thread Starter [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * (@danielwoodhead)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494966)
 * Resolved

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

The topic ‘Div and alignment’ is closed to new replies.

## Tags

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

 * 9 replies
 * 3 participants
 * Last reply from: [danielwoodhead](https://wordpress.org/support/users/danielwoodhead/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/div-and-alignment/#post-3494966)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
