Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    3
    Member #
    32927
    Hi all!

    I want to give the illusion of depth in my website by having a foreground image that is in front of the content, which in turn is in front of the background.

    So far, the best way I can think to do this is to by inserting a foreground div after body but before the content:

    Code:
    <body <?php body_class(); ?>>
    <div id="foreground"></div><!-- #foreground -->
    <div id="page" class="hfeed">
    Then I made the foreground absolutely positioned with a high z-index to overlay everything else. (I'm using full-screen backgrounds, hence the background cover.)

    Code:
    #foreground {
        position: absolute;
        width: 1074px;
        height: 100%;
        min-height: 100%;
        margin: 0 auto;
        background-image: url(images/backgrounds/bigim14_long_foreground.png);
        background-position: 50% 50%;
        background-attachment: fixed;
        background-repeat: no-repeat;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
        z-index: 10000;
    }
    Here's the website: http://www.misfitlounge.com/

    My problem, however, is that while this creates a foreground, it blocks the user from interacting with any of the content, such as clicking links. How should I go about trying to create this effect?

    Thanks!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    #page a {position: relative; z-index: 10001;}

    Repeat for anything you want to be interactive.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member
    Join Date
    Sep 2012
    Posts
    3
    Member #
    32927
    If I do that, though, I lose the background/foreground effect around the content. The content will be in front of the foreground. It's possible that what I'm trying to do...isn't possible...

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    In that case, yes, what you're trying to do unfortunately won't be possible. I've run into the same thing with fixed position divs and what I proposed to you is the answer to getting things to click.

    Having looked at your page, I'm not sure you're going to really gain much from it anyway. When you have a smaller window, the trees overlap the text, which means you can't read it.

    I'd probably rethink this if I were you.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Junior Member
    Join Date
    Sep 2012
    Posts
    3
    Member #
    32927
    Yeah, I figured I'd test the concept before putting a lot of time into fine-tuning the design. I think I'll resort to a compromise where I position the footer over the content so that the content appears to come from behind it.

    Thanks!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:53 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com