HTML Page Formatting
-
I need your help to solve a little html page layout issue I'm having. I recently redesigned my website to use a left-side nav bar. The nav bar is 160 pixels wide. I'd like all the "content" of each page to appear between the 180th pixel and the right side of the browser window. I also want the browser to wrap text so that no horizontal scrolling is needed to read the text, even when the content part of the page has wide images that will require horizontal scrolling. So far, I've been able to accomplish either of these, but not both. Here are a couple links for specific examples: http://www.pjrc.com/tech/8051/board4/first_use.html Here, the browser wraps the text to fit nicely to whatever size the window happens to be, but the content wraps below the nav bar so it's not all from pixel 180 to the right edge. http://www.pjrc.com/tech/8051/board4/first_use_table_formatted.html Here, the content is nicely aligned at pixel 180 all the way down the page, but the browser formats the text to match the width of the widest image, so horizontal scrolling is needed with a window 800 pixels wide (the text doesn't reformat as you resize the window). Horizontal scrolling is the greater of the two evils, but to illustrate how ugly the content can look as it goes from 180-edge to 0-edge, consider this page: http://www.pjrc.com/tech/8051/pm2_docs/functions.html On this page, there aren't graphics, so the table formatting would work... but what I'm really holding out for it a universal approach I can apply to all the page on the site (I generate the nav bars with some scripts, so the script would insert the formatting markup at the top and bottom of the content.) So can I have my cake and eat it too?? My final request is that whatever solution, it needs be HTML 4.01 (I'm slowly working towards 100% validation of the site to 4.01 transitional) and needs to work amoung a wide range of browsers, at least IE 5.0/5.5/6.0, Netscape 4.7x, Mozilla 1.x. A good portion of the people visiting the site are linux users, and some browse with Konqueror, others with Netscape or Mozilla... though I'm less concerned if the solution is standards compliant and Konq has a bug. Feel free to copy these sample page or other pages from the site to play with changing their formatting.
-
Answer:
Hi, I have reviewed the pages that you listed as examples and am basing this answer on my experience as a web devloper for over 7 years. You could easily format the text as you stated in tables so that it would wrap and wouldn't produce the horizontal scrolling. You have that problem already resolved. What I have done when faced with this problem is to layout my page in tables. The left (navigation column would be 160 pixels wide, a second column would be 20 pixels wide with a "blank.gif" image 20 pixels wide inserted into it to hold the correct width regardless of the browser viewing the page. The third column (containing my text would be created to "*" so that it would take up the remainder of the window. Now here is the only solution I have ever reached to keep from dealing with horizontal scrolling with large images. I either 1) embed my images but add the "width" and "height" tags to my "img src" and hyperlink the image to the image so the user can access the larger view or 2) create a thumbnail of my larger images and embed the thumbnail linking it to the larger image. That way I can control the size of the images being displayed regardless of browser type or user screen resolution. This may not be the type answer you are looking for but I have found that it is highly effective on various designs and layouts I have created. It is also completely compliant with HTML standards. It provides consistency across various browser types and screen resolutions and doesn't cause extensive work arounds. I hope that this has been helpful and wish you success with the web site you are designing. Regards, Morningstar
pjrc-ga at Google Answers Visit the source
Related Q & A:
- How To Convert Psd To Html?Best solution by Stack Overflow
- What Is HTML?Best solution by Yahoo! Answers
- How to dispaly HTML page in Silverlight application?Best solution by devproconnections.com
- How to debug an HTML page on mobile?Best solution by msdn.microsoft.com
- How to hide the original page in HTML?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.