Link to home
Start Free TrialLog in
Avatar of John Carney
John CarneyFlag for United States of America

asked on

CSS style definition that makes a nested div align with the bottom of its parent and creates list.

I have a #div named "footer1" directly inside #container. Right now I have it aligned with the bottom of container by specifying margin-top: 418px; how do I write that so that it aligns with the bottom of #container.
Also, how do I make the text in "titles" appear as a bulleted list?

Thanks!
John
HTML CODE:
<div id="container">
	<div id="mainBlock">Today is Sunday, December 16, 2007
		<div id="Block2">This is Block2 inside of which is "titles"
			<div id="titles">
			  <p>This is the title box:Title1 <br />
		        Title2 <br />
	          Title3 </p>
		  </div> 	<!-- end titles -->
		</div> 	<!-- end "Block2" -->
	</div> 	<!-- end "mainBlock" -->
	
	<div id="footer1">
	This is footer1 
	</div> 	<!-- end "footer1" -->
</div>
 
CSS CODE:
#container {
	margin: 0 0 0 80px;
	position: relative;
	background-color: #000000;
	width: 792px;
	height: 418px;
	background-image: url(dreamGirl2.jpg);
	background-repeat: no-repeat;
	font-family: "Arial Black";
	font-size: 14px;
	}
#mainBlock{
	clear:both;
	margin: 10px 0px 0px 20px;
	width: 540px;
	float: left;
	color: #FFFFFF;
	}
#Block2 {
	min-width: 470px;
	height: 200px;
	font-family: "Brush Script MT";
	font-size: 20px;
	margin-left: 20px;
	line-height: normal;
	}
#titles{
	clear:both;
	margin: 0 0 0 20;
	width: 160px;
	float: left;
	font-family: "Gill Sans MT";
	font-size: 12px;
	line-height: normal;
	list-style-type: square;
	list-style-position: inside;
	}
#footer1 {
	background-color: #FF9999;
	font-family: "Monotype Corsiva";
	font-size: 18px;
	text-align: center;
	margin-top: 418px;
}

Open in new window

Avatar of araim
araim
Flag of Poland image

you cannot align it with bottom of the container - you have to fill in the space between the element and the elements above it or use position:absolute.
to make bullets:

add
      #titles p{
            display: list-item;
      }
to your css and change titles to

              <p>This is the title box:Title1 </p>
              <p>Title2 </p>
                <p>Title3 </p>
ASKER CERTIFIED SOLUTION
Avatar of darron_chapman
darron_chapman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Carney

ASKER

The two codes work great to produce the list with buttons, but for some reason ,while #container shows up in the CSS doc, it doesn't show up in the Design Panel in Dreamweaver, nor of course does it show up in the Design view of the html. ???    If we can fix that, I'll be in great shape.

Thanks,

John
What version of DreamWeaver do you use?  I'm using CS3 and it show up both in the CSS Panel and in Design View.  I just created a new page and copied the code directly from this page and everything showed up as expected.
AhH  ... I'm using DreamweaverMX2004.  Is it time for an upgrade?
Well... I'm not sure, maybe someone else knows of something missing in the CSS rule to allow for this to show up in design view in MX2004... I have no way of testing it here.  CS3 does give you a lot more control of CSS rules however and for that reason alone, it might be time for an upgrade.