Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #1339321

    Hello,

    I would like to set a Maximum Width for one Specific Page on my website. How can I define that? Is there a Quick CSS for that purpose or another way?

    Thank you,
    Markus

    #1339324

    Hey Markus,

    Thanks for contacting us!

    Please add following code to Quick CSS field in Enfold theme options > General Styling tab

    
    .page-id-1195 .container {
      max-width: 990px;
    }
    

    1195 in the code is page ID. Please replace it with your page’s ID :)

    Regards,
    Yigit

    #1339365

    Hey Yigit,

    Very helpful! Where do I find the Page ID though?

    Thanks again,
    Markus

    #1339367

    The URL shows this when I’m in the page on WordPress: post.php?post=30&action=edit

    I tried these 2 codes, however it doesn’t work:

    .page-id-30 .container {
    max-width: 990px;
    }

    .post-id-30 .container {
    max-width: 990px;
    }

    #1339368

    Hi Markus,

    You can edit your page and find the page ID in address bar of your browser – https://imgur.com/a/qGZ6t4R

    Cheers!
    Yigit

    #1339369

    Please see the actual page in private content below, if it helps. Thank you! :)

    #1339370

    Hey,

    If it is a post, CSS code should be as following

    .postid-30 .container {
    max-width: 990px;
    }

    Cheers!
    Yigit

    #1339373

    Hey Yigit,

    I tried it, however it doesn’t work. Please see the full URL string in private content below and also the page for reference.

    What do you think?

    #1339374

    Hey,

    Following code should have worked

    .page-id-30 .container {
    max-width: 990px;
    }

    Please try following

    #top.page-id-30 .container {
    max-width: 990px;
    }

    If that does not work either, please copy your CSS code and paste it on – https://pastebin.com/ and share the link here so we can check it for errors.

    Regards,
    Yigit

    • This reply was modified 3 years, 2 months ago by Yigit.
    #1339378

    Hi Yigit,

    Unfortunately it still doesn’t work.

    Here’s the Quick CSS code I have entered so far – please see private content below.

    Thanks in advance for checking!

    #1339380

    Hi,

    There is no error in your CSS. If you are using CSS file merging and compression in Enfold theme options > Performance, please temporarily disable it and check if that helps. Also, if you are using a cache plugin, please make sure to clear cache.

    Cheers!
    Yigit

    #1339383

    Hi Yigit,

    I disabled “CSS file merging and compression in Enfold theme options > Performance” and also cleared the cache on my laptop. Nevertheless the issue is not resolved yet.

    How does the page (link below) display on your laptop/desktop, in full width or not?

    I tried out the following codes after the disabling and cache clearing:
    .page-id-30 .container {
    max-width: 990px;
    }

    .post-id-30 .container {
    max-width: 990px;
    }

    #top .page-id-30 .container {
    max-width: 990px;
    }

    #1339389

    Post ID’s have no additional hyphen. – Page ID’s do have
    so if it is a page with ID : 30 the class on the body tag ( #top ) is: page-id-30
    it is a post with ID : 30 the class on the body tag ( #top ) is: postid-30

    you find those classe as mentioned above on the body tag. ( #top )
    so there is no space between #top and the class : #top.postid-30 or #top.page-id-30
    ( that was a small careless mistake by Yigit )

    it will be :

    #top.page-id-30 .container {
      max-width: 990px;
    }
    /*** or if it is a post ***/
    #top.postid-30 .container {
      max-width: 990px;
    }
    
    #1339396

    by the way : In the other topic I advised you to use a custom class. Otherwise, this code will also affect all other grid rows.

    @media only screen and (min-width:768px) {
    	.flex_cell.avia-builder-el-first {
    	    padding-left: calc(50% - 655px) !important;
    	}
    
    	.flex_cell.avia-builder-el-first .flex_cell_inner {
    	    padding: 30px 50px !important;
    	}
    }

    You always have to remember that if it is not to apply globally.

    #1339440

    Hi,

    Thanks for your help @guenni007 and thanks for pointing out my mistake too. It would probably take some time for me to notice that :) I updated my post.

    Best regards,
    Yigit

    #1339455

    Thanks for noting that, @guenni007! :-)

    So I have input the following 4 Quick CSS now and the page width is still not adjusted: https://negotiations-masterclass.com/reviews/

    #top.page-id-30.container {
    max-width: 990px;
    }

    .page-id-30 .container {
    max-width: 990px;
    }

    #top.postid-30 .container {
    max-width: 990px;
    }

    .postid-30 .container {
    max-width: 990px;
    }

    I also disabled “CSS file merging and compression in Enfold theme options > Performance” and also cleared the cache on my laptop. Nevertheless the issue is not resolved yet.

    What do you think is happening here and how can we resolve it?

    #1339527

    Hi,

    It is not working because the default styling overrides the custom css.

    .responsive .container {
        max-width: 1310px;
    }
    

    Try to prepend the “.responsive” selector to the current one to make it more specific.

    Example:

    .responsive .page-id-30 .container {
        max-width: 990px;
    }
    

    Best regards,
    Ismael

    #1339546

    Hi @Ismael,

    Fantastic! It works! (See link attached for reference)

    However, the custom CSS now also affects the header. I would like the header to appear consistent across all pages.

    What do I need to add so that the header is excluded from the custom CSS?

    Thank you again!!

    #1339583

    Hi,

    Please use the code as following

    .responsive .page-id-30 #main .container {
        max-width: 990px;
    }

    Best regards,
    Yigit

    #1339598

    Something to learn for you ( @markus-fischer ) – when a class is directly on another tag ( like the #top (body tag) ) the class comes without space to the tag.
    #top.page-id-30 if you want to be more specific to a selector ( like here .container ) you can have in front tags of a parent element.
    so – if there are spaces that is the next child in the DOM.

    so your noted rule:

    #top.page-id-30.container {
    max-width: 990px;
    }

    is wrong because the container class belongs to a child element of #top ( grand-child etc. ) to the .page-id-30 – there must be space between.
    page-id-30 – is part of the body tag ( #top) and no child – then you must avoid a space right notation would be:

    #top.page-id-30 .container {
        max-width: 990px;
    }
    #1339796

    Thank you @yigit @guenni007

    It’s working now! :-)

    #1339804

    Hi,
    Glad @yigit & @guenni007 could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Set Maximum Width for Specific Page’ is closed to new replies.