• Hello
    I am relatively new in WordPress. I would like to make one of the pages have a certain design and positions of images using CSS. The WordPress text editor allows me to write HTML but how can I use CSS instead of HTML to create a certain look such as using float, and, a table where I can use terms like border-image etc. Where do I write the CSS codes? Is there such things as CSS design?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Here’s a good starting point: https://www.htmldog.com/guides/css/beginner/

    Thread Starter mthant

    (@mthant)

    No, I mean to ask where I shall write if I want to write CSS in 2016 theme just for a single page. I know it is not a good idea to write javascript or CSS for the whole site. That it can be wiped out when WordPress is updated. But I just want to write CSS for that one single page.
    Is there a CSS editor for that?

    That it can be wiped out when WordPress is updated.

    That’s true for every theme; if you edit the theme files directly your changes will be lost when you update the theme.

    To add custom CSS:
    – If you have a child theme you can add the CSS to the style.css file.
    – If you are using WordPress 4.7+ you can use the “Additional CSS” option in the Customizer.
    – If your theme has a custom CSS option you can use that to add the CSS.
    – If you have Jetpack installed you can enable its Custom CSS module.
    – Otherwise you can install a plugin like https://www.ads-software.com/plugins/simple-css/.

    To apply CSS to a specific page you can use the page id class from the <body> element. You can get that in one of two ways:
    1. In your Admin > Pages > All Pages list, hover over the page title. At the bottom left of the browser window you’ll see “…post.php?post=xxx…” where xxx is the id.
    2. While viewing the page in your browser, use the inspection tool, go the the <body> tag and you’ll see “page-id-xxx”.

    In your CSS, use the page class like so:

    /* change page text to black */
    .page-id-xxx {
        color: #000;
    }
    • This reply was modified 7 years, 9 months ago by bdbrown. Reason: corrected tag id
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using CSS on a single page’ is closed to new replies.