Forums

Give help. Get help.

  • # December 3, 2012 at 11:24 pm

    Hi Folks,

    I have long standing question that I’d love to have answered (and prompted me to sign onto this forum).

    Is there any benefit to specifying “background-repeat: no-repeat;” if the element is sized to fit the background image anyway?

    Example of a graphical title:

    h1 {width: 300px; height: 100px; background: url(‘title.gif’) no-repeat; text-indent: -9999px; overflow: hidden;}

    I do it out of habit and a sense of ‘tidiness’ but I wondered if it might also reduce the page memory load? (as the background image is tiled only once)

    But if the ‘repeat’ property is totally redundant in these cases, I would probably save a lot of time each week by not typing it over and over again.

    Thanks,

    CJ

    # December 4, 2012 at 3:35 am

    Two things in my opinion:
    * Yup, it is kind of redundant since the element has the size of the image
    * But it is a bit more safe in my opinion if in any case the element become wider for X or Y reason

    In the end, it’s up to you.

    # December 5, 2012 at 6:57 pm

    Thanks for the feedback folks!

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

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag