Jump to content

Floating DIV


jwwceo

Recommended Posts

Hello,

 

I am making a page where I want to have a little top corner ad in the top left corner of the page. But I don't want it to affect the other stuff in the page. How do I use a floating div or some kind of CSS manipulation to make sure it doesn't affect the rest of my page.

 

James

Link to comment
Share on other sites

Why just put the add first in your code with everything else following it?

 

This works as well:

<html>
<body>

<div style="position: relative; border: 1px solid green; padding: 10px;">HELLO</div>
<div style="position: absolute; border: 1px solid black; top: 0;">WORLD</div>

</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.