Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > A very basic web deisgn question

A very basic web deisgn question
Thread Tools
Forum Regular
Join Date: Aug 2002
Location: Devon, UK
Status: Offline
Reply With Quote
Aug 4, 2003, 04:26 PM
 
Can anyone tell me how you can create a title banner like the one on this page which scales when you stretch or shrink the web browser horizontally.

I guess its a table cell with a main image and then a small repeating image, but how do you make the image repeat?

Thanks.
     
RGB
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status: Offline
Reply With Quote
Aug 4, 2003, 04:30 PM
 
my html is a bit fuzzy, but in the tag for that cell, after the 'td' put 'background="pathto/yourimage.gif"' and that image will repeat.

(td background="pathto/yourimage.gif"}

The above brackets would be standard HTML ones.
     
Mac Elite
Join Date: May 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Aug 4, 2003, 06:38 PM
 
One thing you could do:

Create a table with 1 row, 2 columns.

First column would be about 600 pixels wide. Don't put anything in it, just make it's background image (the cell backgound, not the table background) the main (non-repeating) part of the banner.

In the second column, leave the width value blank...it should increase or decrease as necessary. Make the repeating part of the image the background in that cell. It need only be about 10 pixels wide. Cell backgrounds automatically repeat.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Aug 5, 2003, 09:17 AM
 
First, set up a block. If you're using table layouts then a TD will do, though in this case you should learn to do real layout. If you're using a real layout, then a div will work best.

Ahem. Assign that block an id; anything will do as long as you don't use that id for anything else on the page. We'll assign our block an id of "foo", for the following:

<. div id="foo">
</div>

Now, in your CSS, set the background of the div to the image you want to use as the div's background. For a div with an id of foo, it might look like this:
Code:
#foo { background-image: url(url-of-image); height: height-of-image; margin: 20px; }
Now here's the trick: Set the height for the div, but do not set a width for it. You can set margins (I set 20-pixel margins in the example), but no width. This will ensure that the browser calculates the width of the div on its own, using the width of the window and the margins you set. This will lead to the cool resizable-banner effect.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Forum Regular
Join Date: Aug 2002
Location: Devon, UK
Status: Offline
Reply With Quote
Aug 5, 2003, 11:23 AM
 
Fantastic! Thanks for the help guys .
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2