Problem with PNG drop shadows on divs

What I’m trying to achieve here, is to have two divs, one containing an image that has the PNG drop shadow around it and a small portion at the bottom for the caption to slide out of, and the second div will contain the caption but must also have the PNG drop shadow on that div as well.

I’m assuming that to get the caption to slide “out” of the bottom of the image from, I need to have it contained within that div. Though, I’m having trouble getting the caption div to overlay the bottom shadow of the image frame div. I can’t figure out a way to get the bottom shadow of the image frame to stay at the bottom of it and not push down past the caption.

Here’s my code so far.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="robots" content="" />
	
	<!-- javascript -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
	<script type="text/javascript" src="scripts.js"></script>
		
	<!-- style sheets -->
	<link rel="stylesheet" href="style.css" type="text/css" media="screen">

	<title>Girl Scouts Picture Frame</title>
	
	<style>	
	body { background:#eee; }
	
	#frame-wrap { margin:20px auto; padding:20px; background:#fff; overflow:visible; }
	
	.innerbox img { margin:0; padding:0; border:0; }
			
	.dropshadow{
		float:left;
		clear:left;
		background: url(shadowAlpha.png) no-repeat bottom right !important;
		background: url(shadow.gif) no-repeat bottom right;
		margin: 10px 0 10px 10px !important;
		margin: 10px 0 10px 5px;
		padding: 0px;
	}
	.innerbox{
		position:relative;
		bottom:6px;
		right: 6px;
		padding:0;
		margin:0;
		overflow:visible;
	}
	.inner1 { background:#aaa; }
	.innerbox{
		/* IE5 hack */
		\\margin: 0px 0px -3px 0px;
		ma\\rgin:  0px 0px 0px 0px;
	}
	.innerbox #bottom { background:#aaa; height:30px; margin:0; }
	#bottom hr { border-color:#888; border-width:1px; margin:25px 0 0 0; padding:0; }
	
	#caption { border-top:2px solid #888; overflow:hidden; }
		#caption .innerbox { padding:15px; }
		#caption p { margin:0; }
	</style>
	
	<script type="text/javascript">
	$(document).ready(function() { 
	
		var capwidth = $('.inner1 img').width();
	
		$('#caption').width(capwidth*0.9);
		$('#imageframe').width(capwidth);
		$('#imageframe #bottom').css('paddingLeft', capwidth*0.05).css('paddingRight', capwidth*0.05);
		
	});
	</script>

</head>
<body>

<div id="frame-wrap">
		
		<div class="dropshadow" id="imageframe">
			<div class="innerbox inner1">
				
				<img src="image.jpg" border="none" width="800" alt="image">
				
				<div id="bottom">

					<hr>

					<div class="dropshadow" id="caption">
						<div class="innerbox">
							
							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
											
						</div><!--innerbox-->
					</div><!--caption-->
				
				</div><!--bottom-->
				
			</div><!--inner1-->
		</div><!--imageframe-->	
		
</div><!--frame-wrap-->

</body>
</html>

Any help is very much appreciated. :slight_smile:

Very close! Essentially what I need to get from there to have the green caption box hanging over the bottom of the image box. It will slide out of the bottom area of the image which will have a fixed height of about 50px.

Would it be possible to get the bottom caption box to hang over the bottom of the image frame?

If anyone could help me out it would be hugely appreciated.

I’ve put a live version up at http://test.sethetter.com/girlscouts/ for viewing. Am I being clear about what I’m trying to achieve here?

Thanks in advanced to anyone willing to help!

You can make the caption hang out by using a negative bottom margin.


<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="robots" content="" />
<!-- javascript -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://test.sethetter.com/girlscouts/scripts.js"></script>
<!-- style sheets -->
<title>Girl Scouts Picture Frame</title>
<style>
@charset "UTF-8";
/* CSS Document */

/* RESET */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
    border:0;
    outline:0;
    font-size:100&#37;;
    vertical-align:baseline;
    background:transparent;
    margin:0;
    padding:0;
}
body {
    line-height:1;
}
article, aside, dialog, figure, footer, header, hgroup, nav, section {
    display:block;
}
nav ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after, q:before, q:after {
    content:none;
}
a {
    border:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
    margin:0;
    padding:0;
}
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:700;
}
del {
    text-decoration:line-through;
}
abbr[title], dfn[title] {
    border-bottom:1px dotted #000;
    cursor:help;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #ccc;
    margin:1em 0;
    padding:0;
}
input, select {
    vertical-align:middle;
}
/* BASIC TYPOGRAPHY */
body {
    font:12px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif
}
a:focus {
    outline:1px dotted invert
}
hr {
    border:0 #ccc solid;
    border-top-width:1px;
    clear:both;
    height:0
}
h1 {
    font-size:25px
}
h2 {
    font-size:23px
}
h3 {
    font-size:21px
}
h4 {
    font-size:19px
}
h5 {
    font-size:17px
}
h6 {
    font-size:15px
}
ol {
    list-style:decimal
}
ul {
    list-style:square
}
li {
    margin-left:30px
}
p, dl, hr, h1, h2, h3, h4, h5, h6, ol, ul, pre, table, address, fieldset {
    margin-bottom:20px
}
/* LAYOUT STYLES */

body {
    background:#eee;
}
#frame-wrap {
    margin:20px auto;
    padding:20px;
    background:#fff;
    overflow:visible;
}
.innerbox:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.innerbox {
    zoom:1.0
}
.innerbox img {
    margin:0;
    padding:0;
    border:0;
}
.dropshadow {
    float:left;
    clear:left;
    background: url(http://test.sethetter.com/girlscouts/shadowAlpha.png) no-repeat bottom right !important;
    background: url(http://test.sethetter.com/girlscouts/shadow.gif) no-repeat bottom right;
    margin: 10px 0 0 10px;
    display:inline;
}
.innerbox {
    position:relative;
    bottom:6px;
    right: 6px;
    padding:0 0 20px;
    overflow:visible;
    background:#aaa;
    margin:auto;
}
#caption {
    margin:0 0 -50px;
    position:relative;
}
#caption .innerbox {
    padding:15px;
}
#caption p {
    margin:0 0 0 30px;
}
.dropshadow .dropshadow {
    position:relative;
    left:35px;
    top:15px;
    margin:0;
}
.innerbox .innerbox {
    background:#aca;
}
</style>
</head>
<body>
<div id="frame-wrap">
    <div class="dropshadow" id="imageframe">
        <div class="innerbox inner1"> <img src="http://test.sethetter.com/girlscouts/image.jpg" border="none" width="800" alt="image">
            <div class="dropshadow" id="caption">
                <div class="innerbox">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>


Thank you! Now I just need to animate the caption sliding down on hover over the image. I think the only issue I’ll have there is the containing div expanding downwards with it, but that shouldn’t be too difficult of a fix.

Thanks a ton for the help. :slight_smile:

Hi,

I didn’t really know how it was supposed to look but I’m guessing it was something like this:


<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="robots" content="" />
<!-- javascript -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://test.sethetter.com/girlscouts/scripts.js"></script>
<!-- style sheets -->
<title>Girl Scouts Picture Frame</title>
<style>
@charset "UTF-8";
/* CSS Document */

/* RESET */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
    border:0;
    outline:0;
    font-size:100&#37;;
    vertical-align:baseline;
    background:transparent;
    margin:0;
    padding:0;
}
body {
    line-height:1;
}
article, aside, dialog, figure, footer, header, hgroup, nav, section {
    display:block;
}
nav ul {
    list-style:none;
}
blockquote, q {
    quotes:none;
}
blockquote:before, blockquote:after, q:before, q:after {
    content:none;
}
a {
    border:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
    margin:0;
    padding:0;
}
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}
mark {
    background-color:#ff9;
    color:#000;
    font-style:italic;
    font-weight:700;
}
del {
    text-decoration:line-through;
}
abbr[title], dfn[title] {
    border-bottom:1px dotted #000;
    cursor:help;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
hr {
    display:block;
    height:1px;
    border:0;
    border-top:1px solid #ccc;
    margin:1em 0;
    padding:0;
}
input, select {
    vertical-align:middle;
}
/* BASIC TYPOGRAPHY */
body {
    font:12px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif
}
a:focus {
    outline:1px dotted invert
}
hr {
    border:0 #ccc solid;
    border-top-width:1px;
    clear:both;
    height:0
}
h1 {
    font-size:25px
}
h2 {
    font-size:23px
}
h3 {
    font-size:21px
}
h4 {
    font-size:19px
}
h5 {
    font-size:17px
}
h6 {
    font-size:15px
}
ol {
    list-style:decimal
}
ul {
    list-style:square
}
li {
    margin-left:30px
}
p, dl, hr, h1, h2, h3, h4, h5, h6, ol, ul, pre, table, address, fieldset {
    margin-bottom:20px
}
/* LAYOUT STYLES */

body {
    background:#eee;
}
#frame-wrap {
    margin:20px auto;
    padding:20px;
    background:#fff;
    overflow:visible;
}
.innerbox:after {
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
.innerbox {
    zoom:1.0
}
.innerbox img {
    margin:0;
    padding:0;
    border:0;
}
.dropshadow {
    float:left;
    clear:left;
    background: url(http://test.sethetter.com/girlscouts/shadowAlpha.png) no-repeat bottom right !important;
    background: url(http://test.sethetter.com/girlscouts/shadow.gif) no-repeat bottom right;
    margin: 10px 0 0 10px;
    display:inline;
}
.innerbox {
    position:relative;
    bottom:6px;
    right: 6px;
    padding:0 0 20px;
    overflow:visible;
    background:#aaa;
    margin:auto;
}
#caption {
    margin:0 0 10px;
}
#caption .innerbox {
    padding:15px;
}
#caption p {
    margin:0 0 0 30px;
}
.dropshadow .dropshadow {
    position:relative;
    left:35px;
    top:15px;
    margin:0;
}
.innerbox .innerbox {
    background:#aca;
}
</style>
</head>
<body>
<div id="frame-wrap">
    <div class="dropshadow" id="imageframe">
        <div class="innerbox inner1"> <img src="http://test.sethetter.com/girlscouts/image.jpg" border="none" width="800" alt="image">
            <div class="dropshadow" id="caption">
                <div class="innerbox">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                </div>
               
            </div>
        
        </div>
    
    </div>
  
</div>

</div>

</body>
</html>


If that’s not right I’d need to see an image of what it should look like :slight_smile: