Options

Using negative margins OK to achieve block position?

ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
edited December 29, 2013 in SmugMug Customization
Is it okay to do this - meaning no negative impact on page load time, or anything else I can't imagine?
Sometimes I put negative margins on several blocks on a page.

In the current text block example I have a -110 top margin, and gave it a 300 px container size. (Not sure the latter was required.)

I don't know any other workaround to position blocks of various uneven sizes. Thanks.

Comments

  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited December 29, 2013
    And yes I did need to set the container width because otherwise the text rolls onto the next photos.
  • Options
    AllenAllen Registered Users Posts: 10,012 Major grins
    edited December 29, 2013
    Might try position.

    .sm-page-widget-xxxxxxxxx {
    position:relative;
    top: -110px;
    }
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited December 29, 2013
    Allen wrote: »
    Might try position.

    .sm-page-widget-xxxxxxxxx {
    position:relative;
    top: -110px;
    }

    Thanks, Allen. In my groping to understand, you are saying... Okay what are you saying? lol. To throw out use of photo blocks and use html, so that this CSS can be used?
  • Options
    ChancyRatChancyRat Registered Users Posts: 2,141 Major grins
    edited December 29, 2013
    Ah, maybe I wasn't clear. These photos are photo blocks. No HTML blocks. Only the text block is other than a photo block.
  • Options
    AllenAllen Registered Users Posts: 10,012 Major grins
    edited December 29, 2013
    I think all the blocks of any type have a specific static class name. .sm-page-widget-xxxxxxxx
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    leftquarkleftquark Registered Users, Retired Mod Posts: 3,784 Many Grins
    edited December 29, 2013
    It's OK to use negative margins. I use them often.
    dGrin Afficionado
    Former SmugMug Product Team
    aaron AT aaronmphotography DOT com
    Website: http://www.aaronmphotography.com
    My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Sign In or Register to comment.