| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > new to css- how to strech the whole layout when a very wide image is loaded. |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2006
Posts: 7
|
new to css- how to strech the whole layout when a very wide image is loaded.
Hello! I am just starting off with web design, so please excuse me if I am wasting your time with some elementary stuff. I got this task to create a 2-column layout with header and footer and right navigation. It should basically look like this http://i.data.bg/06/07/21/35293_orig.jpg (the lighter blue being the content section) My problem is that when a very wide image is displayed in the content(e.g. width="2000") the whole layout has to strech. And this is how mine looks http://proba45.free.bg/HTMLPage.htm while it should look like in the initial state. Could anyone please help? Kindest regards, Valentin |
|
|
|
|
|
#2 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,997
|
Resize the images so they are all the correct size for the page? If you want a larger version available give the visitor the option to enlarge and have a second larger version open in a new window. |
|
|
|
#5 (permalink) |
|
Senior Member
Join Date: Jun 2006
Posts: 295
|
div.container { width: 850px; border: 1px solid red; } div.header { height: 20px; width: 850px; background-color: #666666; } div.right { width: 200px; float: left; } div.left { background: #ccc; width: 640px; float: left; } div.footer { width: 100%; clear: both; background: orange; } the only one that is a % is the footer, which is inside the container so it's 100 percent of 850px, making it 850 pixels wide lol. |
|
|
|
#6 (permalink) |
|
Registered User
Join Date: Jul 2006
Posts: 7
|
It won't work like this either. Here is the source I'm using right now, and here http://proba45.free.bg/HTMLPage.htm you can see how the page looks like with the big image. Do you have an idea why this might be so? Thank you for your help <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Task</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <style type="text/css"> div.container{ width: 850px; border: 1px solid red; } div.header { height: 20px; width: 850px; background-color: #666666; } div.left { width: 200px; float: left; } div.right { background: #ccc; width: 640px; float: left; } div.footer { width: 100%; clear: both; background: orange; } </style> </head> <body> <div class="container"> <div class="header">Header</div> <div class="left"> <p><img src="images/1.jpg" alt=""/></p> </div> <div class="right"> <p><strong>3) More stuff here.</strong> very text make long silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p> </div> <div class="footer"><p>Here it goes the footer</p></div> </div> </body> </html> |
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Jul 2006
Posts: 7
|
Sorry, I've mispasted the code. Here is the one with the percentages, but it still won't work. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Layout 1</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <style type="text/css"> html,body { margin:0.5% 0.5% 0.5% 0.5%; padding:0; display:inline } body { font: 76% arial,sans-serif } div#header h1 { height:80px; line-height:80px; width:100%; margin-bottom:0.5%; padding-left:10px; background-color:#ff9999 } div#wrapper { float:left; width:100% } div#content { float:left; width:74.9%; margin-bottom:0.5%; background-color:#00ccff } div#news { float:left; height:100%; width:25%; margin-left:-25%; background:#0099cc } div#footer { clear:left; width:100%; margin-top:0.5%; background-color:#ba3f3f } </style> </head> <body> <div id="container"> <div id="header"><h1>Header</h1></div> <div id="wrapper"> <div id="content"> <img src="images/1.jpg" alt="" /> </div> </div> <div id="news"> <p><strong>3) More stuff here.</strong> very text make long silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p> </div> <div id="footer"><p>Here it goes the footer</p></div> </div> </body> </html> The page looks exactly the same as the one with the pixels. Any suggestions? |
|
|
|
#10 (permalink) |
|
Registered User
Join Date: Jul 2006
Posts: 7
|
Sorry to bother you with my lamer questions again. I added the div#container section with width:100% but the problem I had before still persists. I hope I'm not making you nervous... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Layout 1</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <style type="text/css"> html,body { margin:0.5% 0.5% 0.5% 0.5%; padding:0; display:inline } body { font: 76% arial,sans-serif } div#header h1 { height:80px; line-height:80px; width:100%; margin-bottom:0.5%; padding-left:10px; background-color:#ff9999 } div#container { width:100% } div#content { float:left; width:74.9%; margin-bottom:0.5%; background-color:#00ccff } div#news { float:left; height:100%; width:25%; margin-left:-25%; background:#0099cc } div#footer { clear:left; width:100%; margin-top:0.5%; background-color:#ba3f3f } </style> </head> <body> <div id="container"> <div id="header"><h1>Header</h1></div> <div id="content"> <img src="images/1.jpg" alt="" /> </div> <div id="news"> <p><strong>3) More stuff here.</strong> very text make long silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p> </div> <div id="footer"><p>Here it goes the footer</p></div> </div> </body> </html> |
|
![]() |