Forums

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

Home Forums CSS css fixed center background image

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #37100
    dcstover1
    Member

    I used the code off from this website for a fixed centered background image and for some reason the image covers the whole page. I tried to make a z-index attribute for it, but then it dissapeared…here is the code in question..

    #bg {
    position:fixed;
    top:-50%;
    left:-50%;
    width:200%;
    height:200%;
    }

    #bg img {
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    margin:auto;
    min-width:50%;
    min-height:50%;
    }

    it also seems to be now competely out of alignment…wasnt like this when i first put the code up??
    http://www.ontariobuyersmarket.ca/exclusive-properties/

    #98803
    Al3ks
    Participant

    Have a look at this, tell me what you think.

    http://jsfiddle.net/kQYbN/

    #98804
    dcstover1
    Member

    well its centered just fine…but its still overlapping most everything on the page, take a look

    http://www.ontariobuyersmarket.ca/exclusive-properties/

    #98805
    Al3ks
    Participant

    Hmm…you need to make sure that the HTML code is pasted right after the body tag.

    #98806
    dcstover1
    Member

    gotcha…but how would you do that within wordpress…the body tags are not viewable within the edit page feature

    #98808
    dcstover1
    Member

    getting closer tracking the body tag down…

    #98809
    Al3ks
    Participant

    Good question, try putting it before the first div tag in your code. Or if you can copy the code from wordpress into JSFiddle and I’ll see what I can do.

    #98813
    Senff
    Participant

    The BODY tag you’ll find in HEADER.PHP.

    Make sure you learn a little about the basics of WordPress before you start fiddling with its many options and start editing files, it’s very easy to screw things up.

    #98814
    dcstover1
    Member

    well the problem is that from what im reading usually the body tags within wordpress are in the header.php file….but i have sifted through a lot of these files and i cant find a single body tag

    #98815
    dcstover1
    Member

    yep, i know this…im pretty good with wordpress…though this is a new theme for me and i cannot find the body tag anywhere

    #98818
    dcstover1
    Member

    i give up for tonight…ive tried header, footer, page, index…nothin

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