Ell20 Posted January 22, 2008 Share Posted January 22, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/87272-first-time-with-divs/ Share on other sites More sharing options...
phpQuestioner Posted January 23, 2008 Share Posted January 23, 2008 using percentages with left and top; with absolute positioning; can sometimes cause problems with different screen size resolutions. you really should use relative positioning and use padding too move the text/links in your "link" div to the position you desire them to be in. Quote Link to comment https://forums.phpfreaks.com/topic/87272-first-time-with-divs/#findComment-446531 Share on other sites More sharing options...
TheFilmGod Posted January 23, 2008 Share Posted January 23, 2008 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: +-------------------------------------------------------------------+ | | | +-----------------------------------------------------+ | | | | | | | | | | +-----------------------------------------------------+ | +-------------------------------------------------------------------+ Quote Link to comment https://forums.phpfreaks.com/topic/87272-first-time-with-divs/#findComment-446594 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.