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?? Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/ 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 Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/#findComment-614328 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. Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/#findComment-614329 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? Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/#findComment-614330 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%. Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/#findComment-614335 Share on other sites More sharing options...
budimir Posted August 12, 2008 Author Share Posted August 12, 2008 Thanks a lot. Cheers!! Link to comment https://forums.phpfreaks.com/topic/119262-solved-adjusting-pae-for-the-resolution/#findComment-614336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.