Jump to content

help with div


shopfor2

Recommended Posts

What you need to use is 'position: absolute;' along with 'position: relative;'

 

Assuming that you need #Layer3 to be located at a postion that overlays #Layer2 or #Layer1, you just add the follower to the #wrapper:

 

#wrapper {

width:1010px;

margin:0 auto;

position: relative;

}

 

Then you add the following to #Layer3:

 

#Layer3 {

position: absolute;

top:0px;

left:0px;

width:1010px;

height:633px;

z-index:1;

 

}

 

Now adjust the 'top' and 'left' css to the desired pixel location.

Edited by newseed
Link to comment
Share on other sites

It all depends. Most will use css background so they can add content over on top and you can do that with one div.

 

Try this on a test page:

 





<br />#box {<br />    width: 200px;<br />    height: 200px;<br />    background: #ff0000;<br />}<br />





Add your text here




 

Although no images were used here but the concept is still the same. You just basically reference a background image instead of a background color. For example, let's say the image you want to use is 200px wide by 100px high, the css would look like this:

 

#box {

width: 200px;

height: 100px;

background: transparent url('image-file-name.jpg') no-repeat;

}

 

Of course you will need to know where the image file is located so you can give it a correct file path.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...