Different formatting results on pages and posts
-
Hi. I’m having a bit of difficulty obtaining the same custom CSS results on my posts that I obtain on my pages. I’ve created a “button” and am able to obtain most of the same formatting on posts and pages, but on the posts I cannot get the text-color to change from the site default red to black (I’ve accomplished that on pages) and on my mobile phone (portrait position) the text wraps onto a second line but the background also wraps instead of expanding in height like it does on the pages. Example of “button” on a page is near the top at https://axeheaven.com/rock-stars/axe-heaven-exlusive-artist-jimi-hendrix/ and example of “button” on post is near the top at https://axeheaven.com/2015/12/07/officially-licensed-david-lozeau-mini-fender-strat-guitar-collection-by-axe-heaven/.
The blog I need help with is: (visible only to logged in users)
-
Hello there!
Dropping this code in your custom CSS area should do the trick:
.single #page .entry-content .shop { color: #000000 !important; display: inline-block; background-color: #D93026 !important; }Let me know if that doesn’t work!
Sage -
Hi there, the following CSS selector in your custom CSS is too broad and you have the !important keyword on the color, which is causing issues.
#page .entry-content aIf you wish to target “pages” with custom CSS, use the “page” CSS class from the opening body HTML tag, like this.
.page .entry-content a
CSS ids will have a # in preceding the name and CSS classes will have a period ( . ) preceding.In your theme all pages and posts have a #page within the HTML. It is the first div in the body tag, so any CSS selector starting with a #page will apply to all pages and posts.
-
Thank you sagebrownell and thesacredpath for responding to my request for help. Sage, a variation of your suggestion proved to be the solution, so I appreciate your contribution very much. :-)
-
-
Thanks so much for your help, Sage!
@jklinedesign: Feel free to open a new thread on this forum if any extra questions come up.
- The topic ‘Different formatting results on pages and posts’ is closed to new replies.