WordPress.org

Support

Support » Themes and Templates » Picture background many sizes

Picture background many sizes

  • Hi!

    I want to add a background behind all of my images.

    But there is different image sizes.

    First I thought I could add backgorund-image to the img tag in CSS, but if there are more than one size, I got problem.

    My second thought was to add a pictur with different sizes to all pciture size.

    How can I do to add a background-image and deside which size of the picture I will use I would use (in CSS)

    Thanks 🙂

Viewing 15 replies - 1 through 15 (of 21 total)
  • esmi

    @esmi

    Forum Moderator

    You’d need to use CSS and an image that tiles seamlessly. Then something like:

    .post img {
    background:url(images/mybg.jpg);
    padding:10px;
    }

    should work.

    Hi!

    Thanks for answering!

    But I mean if I got this sizes:

    150*300

    300*450

    250*300

    How can I decide which img-tag who get the CSS class for size: 150*300, 300*450 and 250*300.

    Because there is a several of image sizes…

    Thanks 🙂

    somebody, please? 🙂

    I think you missed esmi’s advice:

    and an image that tiles seamlessly

    What kind of background are you thinking of?

    Peter

    It is a background with innershadow in all corners.

    I don’ understand what Esmi means, it’s the english 😛

    Thanks 🙂

    I don’ understand what Esmi means, it’s the english 😛

    His or yours? 😉

    Anyway, I think you have to revert to special techniques involving jQuery for such special purposes.

    Peter

    Hehe, it is mine, but I didn’t understand his because I can’t they words 😛

    So, I need to check with javascript and then add a class with javascript that adds the right image for the picture size…

    somebody that can confirme 😛 please 🙂

    Somebody? please 🙂

    please, It is hurry, sorry for “spam posting” but I need help quick 🙂

    *BUMP*

    esmi

    @esmi

    Forum Moderator

    Please don’t bump!

    You can’t use 3 different images as a single element background for an image in one CSS class. You’d need a number of nested (and possibly) floated divs to pull off what I think you’re trying to do.

    And I’m a “she, btw. 🙂

    Hi, sorry hehe!

    I don’t understand to 100% now 😛

    Say I got 5 images, in different sizes, how can I give the pictures different backgrounds dependence on the image size?

    Thanks 🙂

    And I’m a “she, btw. 🙂

    Oops… sorry.

    Peter (definitely a he)

    Hehe, impossible to now, wrote he auotmatically 😛

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Picture background many sizes’ is closed to new replies.
Skip to toolbar