navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Sidebar gradient to match length of content

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Sidebar gradient to match length of content
Page: [1]
 
spinningjennie

 

Posts: 309
Joined: 2/20/2002
From:
Status: offline

 
Sidebar gradient to match length of content - 1/24/2007 19:13:26   
How can I get the height of my sidebar (with its gradient colour fading from top to bottom) to match the height of my content?

Link to Page
Link to stylesheet

With block colour columns I have previously used a 1 px high image and repeated it down the page (y axis). In this case I want this particular gradient in the sidebar to repeat across the page (x axis), so it can fade down the page.

The client prefers the fade going down the sidebar, but I can't get the sidebar gradient to extend to the bottom of the content when my repeat is on the x axis.

Any suggestions much appreciated!
spinningjennie
Tailslide

 

Posts: 5915
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Sidebar gradient to match length of content - 1/25/2007 2:43:33   
What I'd do is make 2 background images.

One is the gradient which would be no longer than the content of the sidebar (assuming that it stays roughly the same length) and again about 2px wide. Repeat that across the width of the sidebar so your sidebar div is filled with the gradient.

Now you need to create a background image for your contentandsidebar div which would be the width of the sidebar and the colour of darkest/lightest bit of the sidebar gradient. Now position that under the sidebar and repeat it vertically down the whole contentandsidebar div.

So what you'll end up with is the gradient image in the sidebar itself and the main gradient colour filling downwards in the gap where the sidebar finishes so it'll look like it's the full length of the content div.

Does that make any sense at all?

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to spinningjennie)
Tailslide

 

Posts: 5915
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Sidebar gradient to match length of content - 1/25/2007 2:58:22   
Here you go: http://www.littleblueplane.com/test/jennie/jennie.html

It will take text-size increases with no problem, even a few decreases.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Tailslide)
spinningjennie

 

Posts: 309
Joined: 2/20/2002
From:
Status: offline

 
RE: Sidebar gradient to match length of content - 1/25/2007 7:40:45   
Tailslide, Works fantastically in FireFox and Opera!! Very neat trick. Thankyou!!

I now see there's an issue in IE6, which I'll investigate tomorrow. Now near midnight in Australia.

In IE6 the sidebar with gradient is pushed down below the blue stripe section. I found that the same pushing down occurred in FireFox when I put a 1 pixel red border around the sidebar, just so I could see where it ended, so I guess it's a width type issue.


Regards and thanks again
spinningjennie

< Message edited by spinningjennie -- 1/25/2007 7:56:08 >

(in reply to Tailslide)
Tailslide

 

Posts: 5915
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Sidebar gradient to match length of content - 1/25/2007 8:18:35   
I didn't check it in IE6 - just IE7 and FF. My guess is that you're right - there's a bit of an overlap issue going on plus the usual IE double margin thing.

I messed with it a bit - should work better now (I've changed some measurements and dumped a div).

http://www.littleblueplane.com/test/jennie/jennie.html

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to spinningjennie)
spinningjennie

 

Posts: 309
Joined: 2/20/2002
From:
Status: offline

 
RE: Sidebar gradient to match length of content - 1/25/2007 23:27:42   
Tailslide, Thankyou for being so thoughtfully conscientious. It now works beautfully in IE6 as well as FF and Opera.

I had forgotten that IE/Win can double the margin on the same side as the float direction and that display:inline fixes this. This seems to be the key to the width fix. And your removal of the #content div, the change of width of #content-inner and the removal of the padding-right on the #content-inner all make for less coding. Very streamlined!

A big thankyou!

spinningjennie

(in reply to Tailslide)
Tailslide

 

Posts: 5915
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Sidebar gradient to match length of content - 1/26/2007 2:38:29   
You're most welcome.



_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to spinningjennie)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Sidebar gradient to match length of content
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts