Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Expanding floated div
Old 03-24-2009, 04:54 PM Expanding floated div
Novice Talker

Posts: 11
Name: Eric
Trades: 0
I have a website layout problem, appreciate any help.

Picture a black vertically scrolling rectangular block centered horizontally. This is where the content goes. The background is gray. On the 4 edges of the block where the black meets the gray, I'd like a shadow. The finished layout would be a black block in the middle of the page with drop shadow coming off of all sides.

I have slices of the shadow, but I don't know exactly how to put it together so that all four sides have a shadow. I considered using 5 float divs, one for each of the shadows and one for the main block (in between the left and right shadows). However, how could I get the left and right shadows to expand to fill the entire height of the main block - but not extend past it?

Thanks for any input.

Last edited by yangez; 03-24-2009 at 04:55 PM..
yangez is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-24-2009, 05:49 PM Re: Expanding floated div
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
One way would be to make a top narrow image of your shadow (running horizontally) and put that in a div. It can be a background image in the div.
Then follow with a div that would be the content area that has a background image maybe 10px high(doesn't really matter how high) that has black in the middle and shadow on both sides. This can be set to repeat-y. It will then fill as long as you have content.
Finally a bottom div for the lower shadow.

I hope I understood your question right?
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 03-25-2009, 10:35 AM Re: Expanding floated div
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
I considered using 5 float divs, one for each of the shadows and one for the main block (in between the left and right shadows).
Why do you guys always approach shadows the hard way ?? Using 5 divs just to get a shadow is ridiculous and unnecessarily complex, there are easier ways to do that.

RacerX is spot on with his method, that's how I do it too
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-25-2009, 04:42 PM Re: Expanding floated div
Novice Talker

Posts: 11
Name: Eric
Trades: 0
Right on. Thanks, guys - that is a lot easier. Now if I could only figure out why Photoshop insists on cutting up my slices into two separate images...
yangez is offline
Reply With Quote
View Public Profile
 
Old 03-26-2009, 09:37 AM Re: Expanding floated div
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Don't let Photoshop do the slicing !!! I don't even use the slice tool any more. I make a selection of what I want, then save the selection. It creates a channel of that selection that I can easily reload any time I need it and it's easily changed if necessary.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Expanding floated div
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26666 seconds with 12 queries