WooZ Posted October 5, 2005 Share Posted October 5, 2005 Hello all, a very basic question: I have a few div's in my page, but when i resize the window the div's just stay in their original position, but i need them to resize along with the whole page. I know it's a very stupid question but i'm just a beginner hey. Greets Link to comment Share on other sites More sharing options...
actionsketch Posted October 5, 2005 Share Posted October 5, 2005 set the div width/height to a percentage.ex: width: 100%; Link to comment Share on other sites More sharing options...
WooZ Posted October 5, 2005 Author Share Posted October 5, 2005 set the div width/height to a percentage.ex: width: 100%;<{POST_SNAPBACK}> I tried this, but as you can see here it still isn't like it should be. Any way how i can fix this? Link to comment Share on other sites More sharing options...
F-Man Posted October 5, 2005 Share Posted October 5, 2005 Absolute position your div using em/px instead of percentages. It is recommended the size of the div to have percentages, but not the area around it. Link to comment Share on other sites More sharing options...
actionsketch Posted October 5, 2005 Share Posted October 5, 2005 I tried this, but as you can see here it still isn't like it should be. Any way how i can fix this?<{POST_SNAPBACK}> It seems to be working for me. although I would suggest that if you're going to make a layout like this, you align everything to one side or the other because aligning with a percentage will look different in a bad way depending on the size of the bowser window. I played with it a little with my handy firefox web dev bar:body{ background-color: #000000; background-image: url(back.jpg); background-repeat: no-repeat; background-position: top left;}div.content {position: relative;top: 130px;width: 525px;height: 60%;border: 1px dashed white;margin: 0;padding: 0;z-index: 4;} dunno if that helps... probably dosent. if you want to keep it centered, then you'll probably have to break the image up into parts and not use any absolute positioning. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now