0

Something really weird happened. I want to change the color of this text but the index file has an !important there and when i change the color on my style.css file it doesn't work. What can i do to over ride that !important.

This is how it looks in my css file

h1.entry-title {
    color: #9A7B5C ;
}

i want that brown color but the index file isn't letting me change it from yellow. Please help and this how the index file looks like

DIV SECTION DIV.container NAV A, DIV DIV ARTICLE.post-860.page.type-page.status-publish.hentry HEADER.entry-header H1.entry-title, DIV DIV ARTICLE.post-860.page.type-page.status-publish.hentry DIV.entry-content P, DIV P STRONG EM A, DIV DIV ARTICLE.post-860.page.type-page.status-publish.hentry DIV.entry-content P.ui-draggable.ui-draggable-handle  {
    color: #ffe206 !important; }
0

Add an id to your h1 and make your rule more specific, and with an important too. You can learn more about specificity here.

4
  • can you please show me how it would look like. please i am desperate – meb Dec 19 '16 at 10:38
  • The HTML: <h1 class="entry-title" id="your-id">A title</h1>, the CSS: h1#your-id.entry-title { color: red !important; } – dgarceran Dec 19 '16 at 11:00
  • word press won't let me add the html part right – meb Dec 19 '16 at 18:27
  • Of course it would, but that's a different question! – dgarceran Dec 20 '16 at 9:03
0

This may break when you update your theme, you may need to look into a child theme to add the id, or change the on-page CSS.

Also, best practice is to not use on-page on inline CSS, for these reasons.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.