Title: Class problems, please help
Last modified: August 18, 2016

---

# Class problems, please help

 *  [sinclasc](https://wordpress.org/support/users/sinclasc/)
 * (@sinclasc)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/class-problems-please-help/)
 * Hi guys,
    I’m trying to centre align a peice of text (using css defined textalign).
   Sounds easy. When I try to choose a class for it, it inserts a blank line above,
   which I don’t want. It does this because I’m using p class or div class. For 
   some reason, when I use span class, the item is not centred.
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  [kickass](https://wordpress.org/support/users/kickass/)
 * (@kickass)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/class-problems-please-help/#post-444598)
 * Try this:
 * p.centered {
    text-align: center; margin: 0 auto; padding: 0; }
 * A span is an inline level element, which is why it doesn’t work. You need to 
   use a block level element like p or h3 to get this to work, then simply style
   the class you apply to it.

Viewing 1 replies (of 1 total)

The topic ‘Class problems, please help’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [kickass](https://wordpress.org/support/users/kickass/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/class-problems-please-help/#post-444598)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
