Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Sprite background repeat

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #37043
    persianlity
    Member

    hi,
    Background image repeat-x Or y not work for me.
    HTML :






    CSS :

    #box{width:220px; height: 230px; margin:0 auto; }
    #box .t {width:220px;height:40px; margin:0 auto;background-image:url(../images/main.png) ;background-position:0 0; background-repeat:no-repeat;}
    #box .m {width:220px;height:180px; margin:0 auto;background:url(../images/main.png) repeat-x 0 -40px;} */repeat-y */
    #box .b {width:220px;height:10px; margin:0 auto;}

    This Printed only background of m class without repeat-x or y . How To Fix This ? this type of writing css for sprite is optimized?

    Thanks.

    #98468
    Senff
    Participant

    You have an example where we can look at this?

    #98471
    persianlity
    Member
    #98473
    Senff
    Participant

    It doesn’t show vertical repetition because the box is 180 pixels high and the image is 300 pixels high, so you won’t see the next instance.

    If I understand correctly what you’re trying to do: you can’t take an area of a sprite, apply it to a box as the background and have (only) that area repeated — it will repeat the entire sprite image.

    #98475
    persianlity
    Member

    Sorry Senff! In Fact, My Mean Is repeat-y . in repeat-y not repeat blue border of 180px height div.

    #98476
    Senff
    Participant

    Again, it will not repeat-y (vertically) because the box is 180 pixels high and the image is 300 pixels high. That, and the fact that you have it commented out in your CSS.

    #98482
    persianlity
    Member

    main image for all images of pages! is not Only for this box. all image sprite in main image 220*300. now i need to border of left and right of m(class) with images (sprite 0 -40). now how to work sprite for my mean .
    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.