Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Question Overlapping Divs (Z-Index)

    Hi All,

    How can I overlap a div to create the following effect:



    Basically I want the girls arm to stand outside the right border.

    Cheers

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    div.mydiv{
    padding-right:100px;
    position:relative;
    border:1px solid #000;
    width:500px;
    margin:0 auto;
    }
    div.mydiv img{
    position:absolute;
    top:50%;
    right:-50px;
    margin-top:-50px;
    }
    Code:
    <div class="mydiv">
    	<img src="myimage.jpg" width="150" height="100" alt="">
    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    	</div>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Thats almost there mate, thanks.

    A couple more things if you dont mind. The text now has a rather large margin on the left. When I try and get rid of this the image moved out of place. How can I remove this margin on the left of the text but keep the image in place?

    Also do i know how i can go about giving an image a transparent background as the image currently has a white one.

    Sorry about all the basic questions, pretty new to this game!

  • #4
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by greens85 View Post
    ...Also do i know how i can go about giving an image a transparent background as the image currently has a white one...
    Do you have photoshop? If not, I'm not sure of a good way to do it. I don't believe it's possible in basic editors such as MSPaint (I might be wrong though).
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    A couple more things if you dont mind. The text now has a rather large margin on the left. When I try and get rid of this the image moved out of place. How can I remove this margin on the left of the text but keep the image in place?
    We neither have your code nor the images. So it's almost impossible to understand your issue. Could you post a link to our page?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Rowsdower - I have both photoshop & fireworks, I'm just not sure how to use them to create a transparent background!

    abduraooft - The code im refering to is the code you pasted me in the first reply. I have attached a screenshot so that you can see how it creates a margin inbetween the left of the site and the content.



    thanks for your time

  • #7
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Ok, try one of these methods for transparency:
    http://www.mediacollege.com/adobe/ph...ackground.html

    If you save it as a gif make sure you check the box for transparency when you create the gif file (after using "save as").
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #8
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    thats done it, thanks mate


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •