Connecting Tech Pros Worldwide Forums | Help | Site Map

need different code for homepage

The Bicycling Guitarist
Guest
 
Posts: n/a
#1: May 30 '07
Hi. My markup is valid but the page sucks when the window is shrunk, the
text going behind the image.

Can anyone suggest a way to fix this while keeping the same general layout
it has now (nav buttons on left, image in center, h1 title text on right)?

The page in question is at www.TheBicyclingGuitarist.net/index.htm

The advice from this and the other ciwa newsgroups have helped me improve my
site a LOT over the years. Just today I replaced <pwith <divfor image
captions on several pages throughout the site as recommended by Jukka in the
stylesheets newsgroup (example at
http://www.TheBicyclingGuitarist.net...images2001.htm )

I'm asking about the specific problem of the <h1text sliding behind the
image when the window is shrunk in the current layout and code arrangement.
If somebody wants to suggest a "makeover" for my home page or any part of my
site, I'm all ears. Thanks.
Chris Watson a.k.a. "The Bicycling Guitarist"



Bergamot
Guest
 
Posts: n/a
#2: May 30 '07

re: need different code for homepage


The Bicycling Guitarist wrote:
Quote:
>
www.TheBicyclingGuitarist.net/index.htm
>
I'm asking about the specific problem of the <h1text sliding behind the
image when the window is shrunk
In your stylesheet:
..photo {
width: 43%;
}

In smaller windows the image may well be wider than 43% of the available
space and overflow its container. Since it comes later in the source
than <h1>, it is automatically on top, hiding part of <h1>. What to do
about it depends on what result you find the least objectionable.

..photo {overflow:hidden} will chop the image off on the right.
..photo img {max-width:100%;height:auto} will resize the image down when
needed, except in IE prior to IE7. JavaScript is required to get
max-width working in IE6-.

You could experiment with min-width on the whole page, but that would
cause horizontal scrolling instead, which is icky, and also requires JS
for IE6.

Another alternative is restructuring the page, putting the photo in the
'welcome' div.

--
Berg
Jim Carlock
Guest
 
Posts: n/a
#3: May 30 '07

re: need different code for homepage


"The Bicycling Guitarist" wrote...
: My markup is valid but ... when the window is shrunk, the
: text goes behind the image.

I haven't played with z-indexing things, but perhaps that's one
way to get things done. I hesitate to mention it, because of my
own lack of implementation, and I'll let others discuss that.

One way to get things done, involves placing everything in their
own <divcontainers. It's a bit more complicated than using a
table, though, so I'll just mention that using a fixed-width table
is the easiest way to do it.

....
<style type="text/css">
table, td { border:0px;padding:0px;margin:0px; }
</style>
</head>
<body>
<table style="width:800px;margin:0px auto;"><tbody><tr>
<td width="200"><!-- left_margin things go here --></td>
<td><!-- content goes here, set to a minimum width to the size of
the largest pic, then adjust the table width by adding up all three
columns, the goal is to consistently present all pages in the same
manner so the end-user doesn't see things jumping around --></td>
<td width="200"><!-- right_margin things go here --></td>
</tr></tbody></table>

: Can anyone suggest a way to fix this while keeping the same general
: layout it has now (nav buttons on left, image in center, h1 title text on
: right)?
:
: The page in question is at www.TheBicyclingGuitarist.net/index.htm

A fixed width table will present scroll bars inside the browser when
the page shrinks below a the table size. You'll need to adjust the
column widths for the right and left sides above as needed.

: The advice from this and the other ciwa newsgroups have helped me
: improve my site a LOT over the years. Just today I replaced <p>
: with <divfor image captions on several pages throughout the site
: as recommended by Jukka in the stylesheets newsgroup (example at
: http://www.TheBicyclingGuitarist.net...images2001.htm )

Something you may want to consider for the images page above,
involves employing a fixed width <divwith margins set to:
style="width:200px;margin:0px auto;" (change the 200px to the
appropriate image-width + 10 or 20 px.

: I'm asking about the specific problem of the <h1text sliding
: behind the image when the window is shrunk in the current layout
: and code arrangement. If somebody wants to suggest a "makeover"
: for my home page or any part of my site, I'm all ears. Thanks.

I took the easy way out on the <h1>text</h1sliding behind the
images.

Hope this helps.

--
Jim Carlock


The Bicycling Guitarist
Guest
 
Posts: n/a
#4: May 30 '07

re: need different code for homepage



"Bergamot" <bergamot@visi.comwrote in message
news:5c5g1kF2vadj7U1@mid.individual.net...
Quote:
The Bicycling Guitarist wrote:
Quote:
>>
>www.TheBicyclingGuitarist.net/index.htm
>>
>I'm asking about the specific problem of the <h1text sliding behind the
>image when the window is shrunk
>
.photo img {max-width:100%;height:auto} will resize the image down when
needed, except in IE prior to IE7. JavaScript is required to get
max-width working in IE6-.
Oh I like the shrinking image trick! I have added it to the index.css
stylesheet. I am confused by all the different IE6 JavaScript hacks that are
out there. Some are jscript, which I suppose is fine because only IE needs
to read them. Please, do you have a favorite JavaScript hack for this
problem with IE6, one that hopefully works for IE5 and even IE5 for Mac if
possible? If you do (or even if you don't), please, how do I implement it?
where do I put the code fragment(s)? Do I need to add anything to my index
page itself, make a separate stylesheet for IE (and if so, again I don't
know how yet), add to my index.css???
Sorry for all the questions.
Thanks again.


Bergamot
Guest
 
Posts: n/a
#5: May 30 '07

re: need different code for homepage


The Bicycling Guitarist wrote:
Quote:
"Bergamot" <bergamot@visi.comwrote in message
news:5c5g1kF2vadj7U1@mid.individual.net...
Quote:
>>
>JavaScript is required to get
>max-width working in IE6-.
>
please, how do I implement it?
google is your friend
http://www.google.com/search?q=max-width%20in%20ie

--
Berg
Closed Thread