Forum Moderators: phranque

Message Too Old, No Replies

screen resolution adjusting code

         

mthorpe

3:07 am on Nov 20, 2004 (gmt 0)

10+ Year Member



is there html code that can be used to change the size of my web page(800x600, 1024x768 etc.)based on the screen resolution settings of visitors?

bill

7:07 am on Nov 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you're using tables for layout you can simply set the width of the table to a set number of pixels. If you want your design to be more flexible then you could use a percentage for a width.

casey133

12:52 pm on Nov 20, 2004 (gmt 0)

10+ Year Member



i would like to know this as well, iv been on sites at different resolutions and it always auto fixes to my resolution...

mattur

1:20 pm on Nov 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Remember the browser window width is not always equal to the screen width. Many folks with high resolution screens use smaller browser windows. Even if folks have maximised browser windows, they may have sidebars open.

As bill says, going liquid avoids most problems.

Presenting pages automatically in different screen resolutions is a neat trick, but I find it wildly annoying (using 1280x1024 screen res).

See this thread for some discussion: Javascript to write stylesheet for different screen resolutions [webmasterworld.com]

mthorpe

2:27 pm on Nov 20, 2004 (gmt 0)

10+ Year Member



hey mattur, i just know basic html, i do not use stylesheets. i am just looking for the easiest code that i can put into my html to auto load the proper screen resolution based on what screen resolution a visitor to my web site is using. how do i put that code, that is on that link you gave me into html code or can i use it like that?

mattur

12:32 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mthorpe, I haven't done this, but you could possibly do it by using javascript to detect screen size, and then write out the relevant fixed width bits. It would be messy, and you'd have to also cope with visitors who have javascript turned off (e.g. googlebot).

My advice is to go liquid and start learning CSS. CSS offers some significant advantages to you and your visitors over all HTML-styling, even if you don't go the whole hog with CSS-P for layout. Learn CSS. imho, it's a better use of your time.

HTH