How to style a page differently from a post ?

  • Alex75017

    #49539

    Dear all,

    Does anyone know how I can style differently my pages on Graphene ?
    I chose to remove the sidebars on pages but I ended up with the content spreading the full width of the page which does not really look good or make it readable (the lines are too long).

    So I just would like to add some space/margins on each side of the paragraphs to center the text somehow and reduce its width , preferably with no plug-ins but rather by editing the CSS file I suppose ?

    Anyone to guide me please ? 🙂

    Thank you so much in advance for any clue or help you can provide me.
    I’ll be very grateful !

    Alexandra

    Admin

    Syahir Hakim

    #49551

    Try copy and paste this code into Customizer > Additional CSS:

    .page.singular #content-main {
    	margin: 0 100px;
    }
    

    You can adjust the margin numbers as required.

    Alex75017

    #49557

    Thank you very much Syahir, I tried your code but it only widened the left margin and the background of the blog encroached on the content area.
    I tried to edit it to get the 2 margins wider (margin: 100 100px;) but it was not the right thing to do as I ended up back wih no margins…

    Finally in the meantime a friend gave me this code which worked just fine 🙂 :

    .page #content {padding-left: 100px ;padding-right: 100px}

    Let me know if this code seems OK to you regarding the CSS and html rules/requirements or how I could have edited yours to get the two margins left and right widened.

    Thank you very much again for your time !

    Admin

    Syahir Hakim

    #49563

    The code you’re using now works fine too.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.