• Hi,

    I have no experience with coding other than some rudimentary css styling. I hope someone can help me with something basic.

    On my single-post pages I would like to widen my right margin for text only. I have images that I would like to keep full-width in the post area. Right now I add the following styling to every paragraph I write

    <p class="alignleft" style="margin-right: 41px;">

    This was ok in the beginning but now that I have over 100 posts and thousands of paragraphs it is a problem if the styling needs an adjustment. Can I establish a unique class for just the text in a single post page and control that class style in style.css?

    Thanks in advance for any help.

    Mark

Viewing 1 replies (of 1 total)
  • @mark,

    You shouldn’t be using inline styling, and no paragraph class needed.

    Simply check the parent element (i.e. parent div) for your single post content area which is perhaps something like id=content and then update your stylesheet:

    #content p {
    margin-right:41px;
    }

    …etc. add more styling as you please. If you only want to style single posts and not any other pages, you may need to customize your theme to make sure that single posts have a unique CSS identifier (selectors):

    https://www.w3schools.com/cssref/css_selectors.asp

Viewing 1 replies (of 1 total)
  • The topic ‘establish custom class for text on single post pages’ is closed to new replies.