0
Welcome Guest! Login
0 items Join Now

SOLVED changing the padding on the mainbody but not

    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • I am trying to change the padding and margins on the mainbody of certain pages using menu page suffixes.

      In my template.less file, I have the following code
      body {
          &.menu-plan-d-acces {
              // this is where I want to modify the padding and margins. For example, I would like the mainbody on this page to have nopaddingtop and nomargintop
          }
      }

      What is the less syntax that I would need to put in there?

      You can see the page here: betelec.ergonomiq.net/societe/plan-d-acces
    • Last Edit: 12 years 1 month ago by Ali Samii.
    • Thank you.

      Ali Samii
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • I would try something like this

      codepen.io/Henning/pen/xBdKv

      (have to admit it took me just a second in plain css but much longer to fiddle the LESS code together :-) )

      body {
      &.menu-plan-d-acces {
          #rt-main {
              [class*="grid"] {
                  & > div.rt-block {
                      margin-top: 0;
                      padding-top: 0;
                      padding-bottom: 0;
                      margin-bottom: 0;
                  }
              }
          }
      }
      }
    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • Thank you Henning. I concur that less is very straight forward, except when it isn't!!! LOL
    • Thank you.

      Ali Samii
    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • And in this case, it isn't straight forward at all.

      Added the code you suggested and it made no difference.

      Cleared caches and all!

      Do you have any other suggestions?
    • Thank you.

      Ali Samii
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • you could just add this

      body.menu-plan-d-acces #rt-main [class*="grid"] > div.rt-block {
      margin-top: 0;
      padding-top: 0;
      padding-bottom: 0;
      margin-bottom: 0;
      }
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • Hmmm seems like it's working now?
    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Re: SOLVED changing the padding on the mainbody but not

    Posted 12 years 1 month ago
    • Hi Henning,

      Yes, I had made an error in the less.
      body {
      &.menu-plan-d-acces {
           #rt-main {
                [class*="grid"] {  // I forgot this line
                     & > div.rt-block {
                          margin-top: 0;
                          padding-top: 0;
                          padding-bottom: 0;
                          margin-bottom: 0;
                     }
                }
           }
      }
      }
    • Thank you.

      Ali Samii

Time to create page: 0.054 seconds