Jump to content

First Time With DIVS


Ell20

Recommended Posts

Hey,

 

I have a background image which is .jpg in a table.

 

I then wanted to create links ontop of the image, I have done and it looks good on this computer but when I switch to a different computer the DIV is no where near in the right place.

 

<style>
#link {
position:absolute;
left:26%;
top:10.5%;
}
</style>

<div id="link"><font size="+2">Home</font></div>

 

I also tried using pixels as the positioning, but this didnt work either.

 

Appreciate any help

Link to comment
Share on other sites

You shouldn't use absolute or relative positioning. Over time you'll build the ability to build a beautiful website from scratch using basic divs.

 

Basic divs - I mean without "position: absolute;" - usually you simply say the width of a div and place it in the right area in the xhtml to make it work.

 

Remember, divs work like rectangles. Browsers like to stack them, not shift them all around the place.

 

For example:

 

+-------------------------------------------------------------------+

|                                                                                              |

|      +-----------------------------------------------------+          |

|      |                                                                          |          |

|      |                                                                          |          |

|      +-----------------------------------------------------+          |

+-------------------------------------------------------------------+

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.