PDA

View Full Version : changing template size depending on content



blah-de-blah
August 15th, 2003, 02:21 AM
I was wondering how sites like these:
http://www.absolutecross.com

Stretch their templates according to their content amount? It seems like there is an image which repeats so it makes the template look longer when there is more content.

If you don't know what i mean, go to different areas of the site, and then look at your scrollbar size. It changes, but the template looks the same, but there is more content :-\

ANyone know howta do this?? thanks!!

abzoid
August 15th, 2003, 06:52 PM
The "trick" is done using tiled background images within table cells for the sides, top and bottom edges so that they'll expand and contract as needed.

Here's the pertinent part of the source code, cleaned up a bit to be easier to read.



<table WIDTH="310" BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#F2F2F2">
<tr>
<td><img SRC="topleft.jpg" WIDTH="19" HEIGHT="29"></td>
<td BACKGROUND="toptile.jpg"><img SRC="topmid_left.jpg" WIDTH="22" HEIGHT="29"></td>
<td BACKGROUND="toptile.jpg" ALIGN="right"><img SRC="topmid_rt.jpg" WIDTH="109" HEIGHT="29"></td>
<td><img SRC="toprt.jpg" WIDTH="26" HEIGHT="29"></td>
</tr>
<tr>
<td BACKGROUND="sideleft.jpg" WIDTH="19">&nbsp;</td>
<td COLSPAN="2" WIDTH="100%" VALIGN="top" BGCOLOR="#F2F2F2" CLASS="smaller-content">
{text content here}
</td>
<td BACKGROUND="sidert.jpg" WIDTH="26">&nbsp;</td>
</tr>
<tr>
<td><img SRC="botleft.jpg" WIDTH="19" HEIGHT="37"></td>
<td BACKGROUND="bottile.jpg"><img SRC="botmid_left.jpg" WIDTH="22" HEIGHT="37"></td>
<td BACKGROUND="bottile.jpg" ALIGN="right"><img SRC="botmid_rt.jpg" WIDTH="109" HEIGHT="37"></td>
<td><img SRC="botrt.jpg" WIDTH="26" HEIGHT="37"></td>
</tr>
</table>

blah-de-blah
August 15th, 2003, 11:37 PM
thanks abzoid, but just to make sure i get this right i have a couple of quesiton :)

Since i made my template in fireworks, i havta insert slices right. So where do i get the bottom tile and the top tiles? Do i just cut out the parts i want tiled, and save them seperately? thanks

abzoid
August 16th, 2003, 12:00 AM
Right, you cut a portion of the graphic from those top and bottom edge slices so that each will tile as desired when used as a background image within the appropriate table cells.

JMS
August 25th, 2003, 09:19 PM
My advice would be to learn dreamweaver. It makes much cleaner sites. Fireworks can make life easy but the code it generates it pretty messy.

Just use Fireworks to output your images and build the site in Dreamweaver.

But if Fireworks does it for you, stick with it i guess. Just means you'll be pretty limited in what you can do.

:)

blah-de-blah
September 7th, 2003, 07:18 AM
Sorry sorta stopped this part for a while so couldn't really have done what i wanted.

Ok so how would you cut a portion from the graphic?? After you export the slices, they automatically each have their own names. Do i just find the right ones and then link it to the table cell? Or is there an easier way?? thanks :P

abzoid
September 7th, 2003, 10:02 AM
Use your graphics software to cut a section from the appropriate slice that is the right height or width. You'll have to do this manually.

blah-de-blah
September 7th, 2003, 10:22 AM
Oh i see....So theres no point making the template into slices is there??? thanks

abzoid
September 7th, 2003, 11:46 AM
No not really, unless you need the other parts for something else you're doing with the page.

blah-de-blah
September 8th, 2003, 05:33 AM
i'm trying that at the moment, but i have this section with links. If i save it as a gif then the buttons won't link :-\ Would it be possible to create the link later on in dreamweaver (i was hoping the buttons would have a rollOver effect)..??

blah-de-blah
September 8th, 2003, 05:38 AM
Oh yea and is there a way just to save a certain object on the stage instead of copying and pasting it to a newpage (in fireworks). Thanks for your time :)