October 20, 201016 yr Hi, i am a newbie to the webworld so this may sound like a silly question. What i am looking to do is create a few websites to help me learn and pick up skills as i go along. What i am looking to do is to create a HTML webpage that will cover the 100% width of the browser (any size screen) without any scrollbars but i am not too sure as to how i can start. I was thinking of having a table with the width of 100%, but i am not sure if this is the best or standard method. If somebody could please guide me as to how i can do this. Thanks in advance.
October 20, 201016 yr If you are just starting, I'd suggest not to touch tables for design layout - it's a bad habit to get into. Use divs and control the widths (etc) with css. This may help you... http://www.devarticles.com/c/a/Web-Style-Sheets/DIV-Based-Layout-with-CSS/
October 20, 201016 yr Don't use tables. Learn some CSS as it isn't so hard. .wrapper { float: left; width: 100%; } in your CSS file will do the job.
October 20, 201016 yr Oh, I forgot to add this: If you want that div to have 100% width of the browser window don't forget to set padding and margin to 0 for html body body { margin: 0; padding: 0; }
October 21, 201016 yr If you want your page to fit any window resolution width you have to code all divs, side margins, side padding, images and all other elements in % to total 100%. For images just code the width and then the height should adjust in proportion:- <img style="width: 20%;" src="image.jpg" alt="description" /> Borders cannot be sized in % so if you have side borders in px make all the % total 97% or 98% to allow for the borders. You may get a vertical scrollbar but should not get a horizontal one. It can be difficult and may look odd when stretched to 1920px window resolution or squashed to say 500px width in a handheld device or a small window, in which case don't use % widths but use min-width and max-width in px for a page container but this won't work in IE6.
October 21, 201016 yr Since your starting out, why not search google for "Fluid CSS Layouts". There are many free layouts on the web for you to use, not templates, just layouts. This will allow you to have a visual medium to learn the basics from quickly. You can then either attempt to make your own layout using the downloaded one as a guide, or simply adjust the downloaded one to suit your needs. As already mentioned, Tables are to be used to display data in a table only. They should NOT be used for web-site layout. The very old method of designing sites did use tables, but that was considered redundant many years ago. There are hundreds of resources out there to learn CSS. Good luck with your design and keep us posted how it goes
October 21, 201016 yr Author Thanks for all your responses, really appreciate it. Wickham, would i be able to apply the same logic as the image to a flash file as well? Sorry just curious...
October 21, 201016 yr I don't know Flash coding but I expect you would have to code the width in % into the object and embed tags that contain the Flash url. Whether you have to code the % width inside the Flash file as well I don't know.
Create an account or sign in to comment