Title: CSS rules doesn&#039;t apply
Last modified: August 31, 2016

---

# CSS rules doesn't apply

 *  [michaeltaube](https://wordpress.org/support/users/michaeltaube/)
 * (@michaeltaube)
 * [10 years ago](https://wordpress.org/support/topic/css-rules-doesnt-apply/)
 * Hey,
    I am using the colormag free theme on my site. I made a child theme and
   it that folder I made a new functions.php and style.css file. My child thme style.
   css is loaded by the functions.php in my child theme folder.
 * The issues I have apply to different rules but some the styles I use for now 
   seem to work. I want to remove the top border of main navigation and justify 
   all my paragraphs.
 * Here is a link to [my site](http://michaeltaube.net) and the code of my style.
   css
 *     ```
       #site-navigation {
           background-color: rgba(0,168,198,0.6);
           border-top: 0px;
           box-shadow: 0 0 2px rgba(0, 0, 0, 0.1) inset;
           position: relative;
       }
   
       body > p {
       	line-height: 150%;
       	text-align: justify;
       }
       ```
   
 * Thank you for time and support!

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

 *  [lelandf](https://wordpress.org/support/users/lelandf/)
 * (@lelandf)
 * [10 years ago](https://wordpress.org/support/topic/css-rules-doesnt-apply/#post-7423337)
 * Hi Michael,
 * For the border, you’ll need to add a bit of specificity since there’s a conflicting
   inline style that’s taking precedence.
 * Try replacing the `#site-navigation` with `#site-navigation.main-navigation` 
   in your code.
 * The selector you used for the paragraphs will only style [direct descendants](https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors)
   of body. This is due to your use of `>` in `body > p`.
 * For example:
 *     ```
       <body>
       	<p>This will have justified text.</p>
   
       	<div class="anything-else">
       		<p>This will not.</p>
       	</div>
       </body>
       ```
   
 * Since everything on your site is within a `<div id="page">` that is within `<
   body>` …your code here won’t have any effect.
 * If your goal is to target all paragraphs, you might as well just use a `p` selector.
 * Although you might want to reconsider using justified text for better readability.
   Google for articles like “Never Justify Type on the Web” if you want to look 
   into it more, but ultimately the decision is up to you.
 * Best of luck!
 *  Thread Starter [michaeltaube](https://wordpress.org/support/users/michaeltaube/)
 * (@michaeltaube)
 * [10 years ago](https://wordpress.org/support/topic/css-rules-doesnt-apply/#post-7423393)
 * [@leland](https://wordpress.org/support/users/leland/):thanks. The selector you
   mentioned for the navigation worked. So it looks almost like I want to have it.
 * Okay what I understand is that only direct childs of body would be effected by
   body > p. Now I used just p as selector to change the line-height to 150%. Thanks
   for the hint not to justify text on the web. I googled it now I understand why.
 * Again. Thank you for your support.
 *  Thread Starter [michaeltaube](https://wordpress.org/support/users/michaeltaube/)
 * (@michaeltaube)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/css-rules-doesnt-apply/#post-7423579)
 * as I wrote earlier that the selector Leland mentioned worked to remove the border
   it’s only true for the top border.
 * My CSS looks like this now
 *     ```
       #site-navigation.main-navigation {
       	border: 0px;
       	padding: 0px;
       	margin: 0px;
       }
       ```
   
 * Anyone has an idea what the reason for this is?

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

The topic ‘CSS rules doesn't apply’ is closed to new replies.

## Tags

 * [<p>](https://wordpress.org/support/topic-tag/p/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [rules](https://wordpress.org/support/topic-tag/rules/)

 * 3 replies
 * 2 participants
 * Last reply from: [michaeltaube](https://wordpress.org/support/users/michaeltaube/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/css-rules-doesnt-apply/#post-7423579)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
