Results 1 to 4 of 4

Thread: How to make a CSS div float OVER another div

  1. #1
    Join Date
    Mar 2008
    Posts
    349

    How to make a CSS div float OVER another div

    Now I know how to build tables in html and css, I teach myself div. I understand the positioning of div blocks not so good. I have the following css code:

    Code:
    div # topbar ( 
    position: absolute; 
    top: 0px; 
    left: 20px; 
    height: 20px; 
    width: 800px; 
    text-align: right; 
    font-family: Tahoma; 
    background-color: # efefef; 
    ) 
    
    div # left (border 
    position: absolute; 
    top: 0px; 
    left: 0px; 
    height: 500px; 
    width: 20px; 
    background-image: url ( "left.jpg"); 
    ) 
    
    div # right (border 
    position: absolute; 
    top: 0px; 
    left: 800px; 
    height: 500px; 
    width: 20px; 
    background-image: url ( "right.jpg"); 
    ) 
    
    div # logo ( 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    height: 100px; 
    width: 800px; 
    background-image: url ( "logo.jpg"); 
    )
    It includes the following html page:

    Code:
    <html> 
    
    <head> 
    <title> div test page </ title> 
    <link href="stijl.css" rel="stylesheet" type="text/css"> 
    </ head> 
    
    <body> 
    <div id="topbar"> </ div> 
    <div id = "left border" </ div> 
    <div id = "right border" </ div> 
    <div id = "logo" </ div> 
    </ body> 
    
    </ html>
    The logo is something strange on left the hand. By placing the logo, It is of the position of the previous div. I do not want that. In the tutorial I follow do not. Since they use just absolute. Who can help me with this?

  2. #2
    Join Date
    May 2008
    Posts
    256

    Re: How to make a CSS div float OVER another div

    First of all, you are missing 3x a ">", careless mistakes, internet explorer doesn't understands. And also omit anything left floating (float: left).

  3. #3
    Join Date
    Mar 2008
    Posts
    349

    Re: How to make a CSS div float OVER another div

    Something still missing. Now I have that on right, and the logo is good, but when I left float is all together. I do not understand so well how to float and clear to work. I will in the future course flexible instead of divs that make static what I have now.

    If I omit borders, and it works, but I use almost borders on every layout I create for example shadow effects, etc.

  4. #4
    Join Date
    May 2008
    Posts
    256

    Re: How to make a CSS div float OVER another div

    For that kind of shadow effects you can download a background image of suit him wide 1600 x 20 pix where this gradient inside.

    Tip, put it there as between:

    Code:
    # body ( 
    margin: 0px auto; 
    )
    Do you also use container divs will be:

    Code:
    # container ( 
    margin: 0px auto; 
    )

Similar Threads

  1. Casting int to float in C
    By Jensen Ackles in forum Software Development
    Replies: 4
    Last Post: 05-04-2010, 05:08 PM
  2. Float vs Double variable
    By Samarth in forum Software Development
    Replies: 5
    Last Post: 19-12-2009, 01:03 PM
  3. How to convert string to float c#
    By Pratyush in forum Software Development
    Replies: 3
    Last Post: 14-08-2009, 01:09 PM
  4. CSS float disappeared the background
    By addie in forum Software Development
    Replies: 3
    Last Post: 29-06-2009, 05:49 PM
  5. CSS : How to float outside parent div
    By Valerian in forum Software Development
    Replies: 4
    Last Post: 21-05-2009, 12:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,545,296.25887 seconds with 16 queries