Override css for a particular page

Community Forums Forums Design Tips and Tricks Override css for a particular page

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  St-Alexis 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #96281

    St-Alexis
    Member
    Post count: 7

    I am am a newbie when it come to CSS, but I would still like to be able to have non standard layout on some page.

    I have done it using TablePress. But TablePress hide the content from Yoast Worpresss SEO. Therefore and want to mimic what TablePress is doing behind the scene.

    So how I do I start within the page content block which currently contains only a TablePress shortcode.

    1) do I add some code to the theme CSS file and invoke it in the page content block.

    2) do I use the <Style> command…

    Is this story by Nathan Rice in the good direction:

    http://www.nathanrice.net/blog/wordpress-2-8-and-the-body_class-function/

    Can someone point me into the right direction where I can find material to learn the technique?

    Thanks

    • This topic was modified 7 months ago by  St-Alexis.
    • This topic was modified 7 months ago by  St-Alexis.
    #96296

    stinkykong
    Participant
    Post count: 169

    You can add a custom body class on any page or post. Look below your content editing area for a single line box for custom body class under your layout settings.

    With a custom body class applied, you can then create new CSS rules but it’s done “per rule” so depending on how much you want to change, you’ll be rewriting CSS rules.

    For example if you have a rule

    .site-inner {
    font-size: 1.6rem;
    }

    then you could change that for your page/post with the custom body class of “yourClassName”

    .yourClassName .site-inner {
    font-size: 3.6rem;
    }

    All text inside .site-inner would be larger on any page with that body class applied.


    Web Design by Websentia Web Services
    http://websentia.com

    #96308

    St-Alexis
    Member
    Post count: 7

    Thanks. That is interesting.

    And what goes in that single line box for custom body class, only the word “myclassname”

    Can I apply more than one class name? If so, the different classnames are simply seperated by a space?

    • This reply was modified 7 months ago by  St-Alexis.
    • This reply was modified 7 months ago by  St-Alexis.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.