budimir Posted August 12, 2008 Share Posted August 12, 2008 Hey guys, I need small help, or better said advice. What are you doing for adjusting the pages for different screen resolutions ? Right now, I have users in my company which are using different resolutions: 1024x768, 1240x1280, 1440x900... I'm using a small javascript snipet which is checking the screen resolution and then loading different web page wich I adjusted for that resolution, but it's not always working correctly. Do you have any better solutions?? Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 Create a site that isn't fixed-width? Plus this would be better in the html/css section Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 12, 2008 Share Posted August 12, 2008 You can make a liquid design. Lets say have your wrapper div's width set to 90% and all its containing divs will wrap to it. I see no need for javascript here. Quote Link to comment Share on other sites More sharing options...
budimir Posted August 12, 2008 Author Share Posted August 12, 2008 @GuiltyGear Can you explain this a little bit more? Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 12, 2008 Share Posted August 12, 2008 Thats just some basic css. U dont set a fixed width for an element (like width:850px); but u set it to a percentage, like width:90%;. Basically: [div id=wrapper" style="width:90%] [div id=content]Some Content[/div] [div id=sidebar]Sidebar here[/div] [/div] Everything will wrap depending on the resolution, so if the guy has a 1024px resolution, the page width will be 90% of 1024 = ~921px. Thats the same for bigger resolutions. I suggest reading something on liquid layouts; u can search on google as there are quite a lot. EDIT: I took for granted that all the other elements inside the wrapper will have no width, but thats rarely the case. If u want to set a width for "content" u must set it also to a percentage, as a fixed width will have no effect for a liquid layout. So lets say u may end with: content width=70% and sidebar width=30%. Quote Link to comment Share on other sites More sharing options...
budimir Posted August 12, 2008 Author Share Posted August 12, 2008 Thanks a lot. Cheers!! Quote Link to comment 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.