|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, Everyone,
Here's a doozie for ya. Im very well versed in web deveopment - been designing for years. Client of mine comes to me and asks me to build a site. One problem: he wants the pages - when resized - to resize with the browser. No problem, right? Create some 100% table widths in, set the image sizes to, lets say 60%, throw in the align=right on the images. Ok? Done. Not yet. He wants the actual fonts to increase in size as the browser does. For instance, 640x480 users might see the font as 12px, but 1280 by 1024 users see the font size as, lets say, 16px. Now I know this can be done, but I don't know how. (when you export a powerpoint presentation, it does it using that funky css/xml combo.) Any help? I want to take the job, but want to make sure I can do this. |
|
#2
|
||||
|
||||
|
strange but not difficult. Using javascript to detect screen.height and screen.width, depending on these for resolution, you dynamically use a different CSS.
Pseudocode is... If screen width is less than or equal to 800 then document.write ('<LINK REL="stylesheet" HREF="/800x600.css" TYPE="text/css">'); Else if width is less than 1024 and greater than 800 then document.write ('<LINK REL="stylesheet" HREF="/1024x768.css" TYPE="text/css">'); Else document.write ('<LINK REL="stylesheet" HREF="/over1024.css" TYPE="text/css">'); Use javascript to allow yourself to dynamically write whatever CSS script you want. You'll need a body tag like this so that if the user resizes the screen the appropriate CSS will be written: <body onresize="javascript:location.reload();"> ALTERNATIVELY.... Do it in Flash. You can set parameters for height and width which will scale the site to the browser size. It's a PAIN to keep a flash site up to date if you don't know how to integrate Flash and databases or dynamic text. I'd try to the first option. Take the job. |
|
#3
|
||||
|
||||
|
Here is something that may stink but i don't think there's a way around this... if someone is filling out a form on this site and just happen to resize the window (not knowing about your potential client's desires) then when the screen refreshes the form will be cleared which may annoy people. Also make sure that the site is not graphic heavy or else a dial-up user who waits 2 minutes for the site to load will have to wait another 2 minutes if they resize the screen. that's not fair.
Just remember, your job is to do wahtever your client wants, not to help him/her decide how to make the site user-friendly... unless he/she ASKS for your input. |
|
#4
|
||||
|
||||
|
if you do not want to change the CSS depending on the size of the browser window and you want to control the CSS strictly based upon POTENTIAL or AVAILABLE screen width then you would use Javasscript's window.screen.availWidth to detect if they have 640, 800,1024,1280, or higher and then the document.write depending on that.
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Resize fonts with browser resolution? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|