Title: wordpress body reference classes
Last modified: August 20, 2016

---

# wordpress body reference classes

 *  Resolved [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/wordpress-body-reference-classes/)
 * Hello
 * I’m trying to find examples of how to combine body reference classes, like this:
 *     ```
       .entry-content, .entry-summary {
           clear: both;
           padding: 30px 0 0;
       }
       ```
   
 * but only apply it to
 * .attachment
 * or
 * .page-id
 * ect..
 * I don’t seem to know how to write it, for example,
 *     ```
       .attachment .entry-content .entry-summary {
       padding: 20px;
       }
       ```
   
 * applies to all elements which use the content and sumary div.
    I only want it
   to apply to attachments.
 * please help me fill the gaps in my understanding, thanks.

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

 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/wordpress-body-reference-classes/#post-2651327)
 * A single element padding to attachment!
 *     ```
       .attachment {
          padding: 20px;
       }
       ```
   
 * An array of elements padding to both attachment and entry-content
 *     ```
       .entry-content,
       .attachment {
          padding: 20px;
       }
       ```
   
 * An combination of elements padding to only the attachment when it is **nested
   inside** the entry-content, requires both classes
 *     ```
       .entry-content .attachment {
          padding: 20px;
       }
       ```
   
 * Twenty Ten style.css combined example, only when the attachment-thumbnail class
   is nested inside the gallery-columns-4 class.
 *     ```
       .gallery-columns-4 .attachment-thumbnail {
       	max-width: 84%;
       	height: auto;
       }
       ```
   
 * HTH
 * David
 *  Thread Starter [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/wordpress-body-reference-classes/#post-2651343)
 * yes! that’s exactly what I was looking for. Thank you!

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

The topic ‘wordpress body reference classes’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/wordpress-body-reference-classes/#post-2651343)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
