![]() |
|
|||||||
| Notices |
| Help and New Mac User Support There's no such thing as a stupid question here. Flame free zone. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||||
|
Hi,
I have searched and searched regarding this topic and tried many things with no luck. I am out of ideas. I need your help MacTalk. I am creating a site, I have a <div> with two <span>'s in it, one containing the main content. I would like the <div> to stretch to fit all of the content, so far I have not been able to get this to work. Here is a snippet of the HTML code: Code:
<div id="contenttop" align="center"></div> </center> <center> <div id="contentbody" align="center"> <br /> <span id="titlefont">Test</span> <br /><br /><br /> <!-- Editable Content--> <span id="contentfont"><!--#include virtual="include/About.txt" --></span> <!-- End Editable Content--> <br /><br /> </div> </center> <center> <div id="contentbottombar" align="center"></div> </center> Here is a snippet of the CSS code: Code:
#contentbody {
width: 700px;
z-index: 2;
margin-left: auto;
margin-right: auto;
background-color: #CCCCCC;
border-right-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #999999;
border-left-color: #999999;
}
#contenttop {
width: 702px;
height: 11px;
background-image: url(../images/contenttop.png);
background-repeat: repeat-x;
background-position: top;
z-index: 3;
margin-left: auto;
margin-right: auto;
}
#contentbottombar {
width: 700px;
height: 12px;
background-image: url(../themes/balloons/cloudbar.png);
background-repeat: repeat-x;
background-position: bottom;
z-index: 4;
border: 1px solid #999999;
margin-left: auto;
margin-right: auto;
clear: both;
}
#contentfont {
font-family: Arial;
font-size: small;
color: #444444;
text-align: left;
margin-left: 20px;
margin-right: 20px;
width: 660px;
height:auto;
float: left;
z-index: 2;
}
#titlefont {
font-family: Arial;
font-size: x-large;
color: #B40138;
text-align: left;
float: left;
margin-left: 20px;
text-shadow: rgba(0,0,0,0.5)1px 1px 0px;
font-weight: bold;
line-height: 200%;
width: 700px;
}
Any help would be greatly appreciated. Thank you,
__________________
Meh 626 & Meh626.com iMac G4 800Mhz PowerPC, 17", Mac OS X Tiger iPhone 3GS 16GB Black Optus Successful Trades: Huy, darksplat, The Architect.mac, Beau and Jordan M. |
|
|||||
|
I'm not sure this is the best fix, but it should accomplish what you're after anyway.
In the HTML file, change this portion: Code:
</span> <!-- End Editable Content--> <br /><br /> </div> Code:
</span> <!-- End Editable Content--> <br /><br /> <div style="clear:both;"></div> </div> Here's the same page with that change applied (hosted off my temp server): Meh626 DIV Stretching Help!
__________________
iMac Core 2 Duo/1.83GHz PowerBook G4 Titanium/867MHz iPhone 3G 8GB Last edited by iMac600; 31st May 2009 at 06:15 PM. |
|
|||||
|
Quote:
__________________
Meh 626 & Meh626.com iMac G4 800Mhz PowerPC, 17", Mac OS X Tiger iPhone 3GS 16GB Black Optus Successful Trades: Huy, darksplat, The Architect.mac, Beau and Jordan M. |
|
||||
|
Quote:
At any rate, those balloons scare me, you might want to fix the magic wand job on the sides of them. |
|
|||||
|
Worth looking at if you want to create bulletproof, complex CSS layouts quickly: Blueprint: A CSS Framework | Spend your time innovating, not replicating
__________________
iStat for iPhone! Over 12 million widgets and apps downloaded: iSlayer.com (RSS), iPhone apps: Bjango.com (RSS, Twitter) Record TV easily: IceTV (RSS, IceTV iPhone app, Twitter) |
|
|||||
|
Quote:
Code:
position: relative; Code:
position:absolute; right:0;
__________________
iMac Core 2 Duo/1.83GHz PowerBook G4 Titanium/867MHz iPhone 3G 8GB |
|
||||
|
Quote:
|
|
|||||
|
Quote:
Quote:
Thanks all.
__________________
Meh 626 & Meh626.com iMac G4 800Mhz PowerPC, 17", Mac OS X Tiger iPhone 3GS 16GB Black Optus Successful Trades: Huy, darksplat, The Architect.mac, Beau and Jordan M. |
|
|||||
|
Quote:
(FWIW, I only use the grid file in Blueprint.) Meh 626: Sorry for the mini hijack, but if you were using 960 or Blueprint, you could have knocked the CSS and HTML for that page up in 5 mins and be confident it'd work in all browsers.
__________________
iStat for iPhone! Over 12 million widgets and apps downloaded: iSlayer.com (RSS), iPhone apps: Bjango.com (RSS, Twitter) Record TV easily: IceTV (RSS, IceTV iPhone app, Twitter) |
![]() |
| Bookmarks |
| Tags |
| contents, css, div, fit, stretch |
| Thread Tools | |
| Display Modes | |
|
|