CSS - How To Get Sub Menu To Appear Directly Below Parent.
Hey everyone,
I am working on a design of mine, and so far it is coming along very well. The problem is, when I am working with the menu, I cannot get the sub menu to appear directly below the parent. Here is a screen shot of what is happening. I hovered over the 2nd menu item, and the sub menu appeared under the 1st. I know why it is doing it, I just can't seem to fix it. Here is my code: html4strict Code: Original - html4strict Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title></title> <script type="text/JavaScript" src="jquery.js"></script> <style type="text/css"> * { margin: 0; padding: 0; } a:focus, a img { outline: 0 none; border: 0 none; } a { text-decoration: none; color: #8D1D45; } html,body { text-align: center; background-color: #C5CED5; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; font-size: 13px; height: 100%; width: 100%; } #container { width: 852px; background-color: #FFFFFF; text-align: justify; margin: 0 auto; overflow: hidden; height: auto; } #header { background-image: url( http://img103.imageshack.us/img103/8229/header02bd6.jpg ); background-repeat: no-repeat; height: 130px; } #header h1 { color: #8D1D45; letter-spacing: -0.1em; font-size: 26px; margin-left: 300px; padding-top: 50px; } #header span { color: #687788; } #menu { width: 100%; margin-top: 6px; margin-bottom: 5px; } #menu li { display: inline; margin-right: -5px; } #menu a { background-color: #FFF200; opacity: 0.7; filter: alpha(opacity=70); padding: 5px 76.3px; border: 1px solid #000000; } #menu ul ul { display: none; float: left; margin-right: 4px; } #menu ul ul li { display: block; line-height: 30px; } #menu ul ul li a { display: block; max-width: 110px; padding: 5px 80px; } #menu ul ul li.first { margin-top: 6px; } </style> <script type="text/javascript"> function show( id ) { $( "#" + id ).show("slow"); } function hide( id ) { $( "#" + id ).hide("slow"); } </script> </head> <body> <div id="container"> <div id="header"> <h1>ryon.<span>hunter</span></h1> </div> <div id="menu"> <ul> <li><a onmouseover="show('sub1')" onmouseout="hide('sub1')" href="">Tutorials</a></li> <li><a onmouseover="show('sub2')" onmouseout="hide('sub2')" href="">Tutorials</a></li> <ul id="sub1"> <li class="first"><a href="">PHP</a></li> <li><a href="">MySQL</a></li> <li><a href="">CSS</a></li> <li><a href="">X/HTML</a></li> </ul> <ul id="sub2"> <li class="first"><a href="">PHP</a></li> <li><a href="">MySQL</a></li> <li><a href="">CSS</a></li> <li><a href="">X/HTML</a></li> </ul> </ul> </div> </div> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" I am only testing it in FF2 at the moment, I will test other browsers when I get it working in FF. P.S. Does anyone know how to get my menu to stay when the menu items are being hovered over? So far it just goes away when I take the cursor off of the top menu. Similar TutorialsHi guys wonder if i could get a hand, I have a problem with an applet from the bbcnews website - essentially my portal has dynamic content, and sometimes this is pushed against the menu bar. It works fine, until used in IE6/7, when you roll over the parent on the menu bar, the child goes under the applet, again only in IE. I have tried every type of z-index trick going to no avail - is it an issue with the JScript or css, and more to the point is there a fix? Thanks a million for you help in advance, as theres no upload script here and this portal is in a secure location i'll copy the test code below for you to generate an htm with. <--------> CODE <--------> Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "(URL address blocked: See forum rules)"> <html xmlns="(URL address blocked: See forum rules)"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { font-family: arial, helvetica, serif; } #nav, #nav ul { /* all lists */ padding: 0; margin: 0; list-style: none; float : left; width : 11em; z-index:5; } #nav li { /* all list items */ position : relative; float : left; line-height : 1.25em; margin-bottom : -1px; width: 11em; } #nav li ul { /* second-level lists */ position : absolute; left: -999em; margin-left : 11.05em; margin-top : -1.35em; } #nav li ul ul { /* third-and-above-level lists */ left: -999em; } #nav li a { width: 11em; w\idth : 10em; display : block; color : black; font-weight : bold; text-decoration : none; background-color : white; border : 1px solid black; padding : 0 0.5em; } #nav li a:hover { color : white; background-color : black; } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul { left: -999em; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { /* lists nested under hovered list items */ left: auto; } #content { margin-left : 12em; } </style> <script type="text/javascript"><!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]></script> </head> <body> <table width="200" border="0"> <tr> <td><ul id="nav"> <li><a href="#">Percoidei</a> <ul> <li><a href="#">Remoras</a> <ul> <li><a href="#">Echeneis</a> <ul> <li><a href="#">Sharksucker</a></li> <li><a href="#">Whitefin Sharksucker</a></li> </ul> </li> <li><a href="#">Phtheirichthys</a> <ul> <li><a href="#">Slender Suckerfish</a></li> </ul> </li> <li><a href="#">Remora</a> <ul> <li><a href="#">Whalesucker</a></li> <li><a href="#">Spearfish remora</a></li> <li><a href="#">Marlinsucker</a></li> <li><a href="#">Remora</a></li> <li><a href="#">Ceylonese remora</a></li> </ul> </li> <li><a href="#">Remorina</a> <ul> <li><a href="#">White suckerfish</a></li> </ul> </li> <li><a href="#">Rhombochirus</a> <ul> <li><a href="#">R. osteochir</a></li> </ul> </li> </ul> </li> <li><a href="#">Tilefishes</a> <ul> <li><a href="#">Caulolatilus</a></li> <li><a href="#">Lopholatilus</a></li> <li><a href="#">Malacanthus</a></li> </ul> </li> <li><a href="#">Bluefishes</a> <ul> <li><a href="#">Pomatomus</a></li> <li><a href="#">Scombrops</a></li> <li><a href="#">Sphyraenops</a></li> </ul> </li> <li><a href="#">Tigerfishes</a> <ul> <li><a href="#">Amniataba</a></li> <li><a href="#">Bidyanus</a></li> <li><a href="#">Hannia</a></li> <li><a href="#">Hephaestus</a></li> <li><a href="#">Lagusia</a></li> <li><a href="#">Leiopotherapon</a></li> <li><a href="#">Mesopristes</a></li> <li><a href="#">Pelates</a></li> <li><a href="#">Pelsartia</a></li> <li><a href="#">Pingalla</a></li> <li><a href="#">Rhyncopelates</a></li> <li><a href="#">Scortum</a></li> <li><a href="#">Syncomistes</a></li> <li><a href="#">Terapon</a></li> </ul> </li> </ul> </li> <li><a href="#">Anabantoidei</a> <ul> <li><a href="#">Climbing perches</a> <ul> <li><a href="#">Anabas</a></li> <li><a href="#">Ctenopoma</a></li> </ul> </li> <li><a href="#">Labyrinthfishes</a> <ul> <li><a href="#">Belontia</a></li> <li><a href="#">Betta</a></li> <li><a href="#">Colisa</a></li> <li><a href="#">Macropodus</a></li> <li><a href="#">Malpulutta</a></li> <li><a href="#">Parosphromenus</a></li> <li><a href="#">Pseudosphromenus</a></li> <li><a href="#">Sphaerichthys</a></li> <li><a href="#">Trichogaster</a></li> <li><a href="#">Trichopsis</a></li> </ul> </li> <li><a href="#">Kissing gouramis</a></li> <li><a href="#">Pike-heads</a></li> <li><a href="#">Giant gouramis</a></li> </ul> </li> <li><a href="#">Gobioidei</a> <ul> <li><a href="#">Burrowing gobies</a></li> <li><a href="#">Dartfishes</a></li> <li><a href="#">Eellike gobies</a></li> <li><a href="#">Gobies</a></li> <li><a href="#">Loach gobies</a></li> <li><a href="#">Odontobutidae</a></li> <li><a href="#">Sandfishes</a></li> <li><a href="#">Schindleriidae</a></li> <li><a href="#">Sleepers</a></li> <li><a href="#">Xenisthmidae</a></li> </ul> </li> </ul></td> <td><!-- BBCi Syndication --><noscript><a href="http://www.bbc.co.uk/news" target="_BBC"><img src="http://newsimg.bbc.co.uk/shared/bsp/hi/services/htmlsyndication/img/synd_js_error_js-inactive.gif" width="165" height="200" border="0" alt="BBCi: Javascript is not available on this browser"/></a></noscript><script src="http://www.bbc.co.uk/syndication/html/jsserver/1096038497229" language="JavaScript" style="z-index:1;" type="text/javascript"></script><!-- /BBCi Syndication --></td> </tr> </table> </body> </html> Hello everyone, I have a drop-down menu that is currently working well. The only change I need to make is to have the right edge of the drop-down menu to align with the right edge of the parent menu. When you hover over the menu, it currently "drops" down and to the right, with the left edges aligned. I want the menu to "drop" down and to the left, so the right edges are aligned. I have tried fiddling with floats and absolute/relative positioning. I'm not sure what needs to be changed. Any help you can provide is greatly appreciated! I'm learning via "cut and paste", so please go easy on any terminology you may use. Thank you! Here is the page: http://www.littlebuddymedia.com/site05/012.html The menu currently drops like this (aligned along the left edge): http://www.justskins.com/wp-content/uploads/2008/12/drop-down-menu.gif I want the menu to do this (align along the right edge; see how "Artists" is aligned under "Music" along the right edge): http://artatm.com/wp-content/uploads/2009/11/mtvmenu.JPG Here is my code: Code: .chromestyle{ width: 100%; font-weight: bold; float: left; height: 29px; } .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/ content: "."; display: block; height: 0; clear: both; visibility: hidden; } .chromestyle ul{ border: 0px solid #BBB; width: 100%; background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/ padding: 4px 0; margin: 0; text-align: right; /*set value to "left", "center", or "right"*/ } .chromestyle ul li{ display: inline; } .chromestyle ul li a{ color: #000000; padding: 4px 7px; margin: 0; text-decoration: none; border-left: 1px solid #DADADA; } .chromestyle ul li a:hover, .chromestyle ul li a.selected{ /*script dynamically adds a class of "selected" to the current active menu item*/ background: url(chromebg-over.gif) center center repeat-x; /*THEME CHANGE HERE*/ } /* ######### Style for Drop Down Menu ######### */ .dropmenudiv{ position:absolute; top: 0; border: 1px solid #BBB; /*THEME CHANGE HERE*/ border-bottom-width: 0; font:normal 12px Verdana; line-height:18px; z-index:100; background-color: white; width: 200px; visibility: hidden; } .dropmenudiv a{ width: auto; display: block; text-indent: 3px; border-bottom: 1px solid #BBB; /*THEME CHANGE HERE*/ padding: 2px 5px; text-decoration: none; font-weight: bold; color: black; } * html .dropmenudiv a{ /*IE only hack*/ width: 100%; } .dropmenudiv a:hover{ /*THEME CHANGE HERE*/ background-color: #0000ff; color: #fff200; } Is it possible mix inline and block-level elements directly together?? For example: Code: <div....> <input..... /> <-- inline element <ul>... <-- block element </div> Thank you I've tried margin: 0 auto; and that didn't work. Is there any style you can apply directly to an image to vertical align it at the top or the bottom? Please look at this page - http://hometown.tmhdesign.com/ask.asp?faq=9 See how the <p> exceeds the containing box at the bottom? I put a border-bottom on the containing div to show you where the issue occurs. It does not happen in IE7 I just noticed it does it also on this page http://hometown.tmhdesign.com/staff.asp I'm using a web application for an online survey system. The pages rendered are XHTML transitional ("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">")... but it doesn't validate (a big problem, I know). It looks like this initially... ...and I'm trying to indent the entire element below the header text like so... ...but the problem is that it applies the change not only the parent TABLE/DIV combo, but then the children as well (which is why the radio buttons ended up being shifted over too I believe). I can't change any of the code of the application, but the application references an external CSS file that I can edit only (so I can't change the fact that there aren't many/any classes assigned to the elements to use directly... but I can modify this one file and have the changes applied). What I've tried thus far is to use either of the following... Code: TABLE DIV {position: relative; left: 25px;} TABLE DIV {padding-left: 25px;} I found the tree using Firebug for Firefox. Is there a way to make the CSS code be applied to only the first/parent TABLE/DIV combo and not it's children? Maybe I could start with BODY TABLE DIV or something? I would really appreciate any assistance possible. I am confused by the "rules" of how to indicate what you are trying to style when an element is within other elements. Specifically in this case (but hopefully this lesson will be portable to other contexts). I have a UL with an LI (classed) that is within an id'd UL that is within an id'd DIV. Code: <div id="horzmenu"> <ul id="horznavmenu"> <li><a href='rooms.php'>Accomodations</a></li> <li class='hot'>Location & Info <ul> <li><a href='/otherprops.php'>Other Properties</a></li> <li><a href='/news.php'>News & Photos</a></li> </ul> </li> <li><a href='booking.php'>Booking</a></li> </ul> </div> So if I were to wish to style this new UL and its LI's do I refer to: The parent UL as in: #horznavmenu ul ul { The parent UL and the class'd LI as in: #horznavmenu ul ul li.class{ Or? Thanks in advance for any feedback or suggested reading... Is there a way to get the style sheet to let the inner tag to override the parent's tag? Seem that only one webpage need that while many other doesn't. I'll post the code below, take a look at the text-align:left ...... Code: <div style="margin:0px;padding:25px 30px;text-align:left;"> <img style="text-align:center;" src="..."> </div> Is there a way to get the style sheet to let the inner tag to override the parent's tag? Seem that only one webpage need that while many other doesn't. I'll post the code below, take a look at the text-align:left ...... Code: <div style="margin:0px;padding:25px 30px;text-align:left;"> <img style="text-align:center;" src="..."> </div> Hey AHH I know that there is a lot of code to look at but I'm only working on the middle box with the cross. All I am wanting to figure out right now is how to get the parent div.icross to show all it's background in FF. It shows and looks how I want it to look in IE, so you can use that as reference. You guys are always so much help and I REALLY appercaite it. Thanks so much to whoever helps me. - Jacenta Here is the page: tri-m.com/index_newlayout.html Here is the css that only corresponds to the middle to make things easier for you to see: Code: div.icross /* index cross */ { background:url(trim_images/layout/cross_background.gif); background-color:#FFFFFF; background-repeat:no-repeat; background-position:top; width:540px; height:1%; } div.ilogo /* logo in cross, top left box */ { width:192px; height:57px; margin-right:1px; margin-bottom:2px; float:left; text-align:right; padding:0; } div.ind /* name/description in cross, top right box */ { width:346px; height:57px; margin-left:1px; margin-bottom:2px; float:right; text-align:right; padding:0; } div.iimage /* image in cross, bottom left box */ { width:192px; float:left; margin-right:1px; margin-top:1px; height:1%; } div.iinfo /* info in cross, bottom right box */ { width:346px; float:right; margin-left:1px; margin-top:1px; text-align:left; height:1%; } .trimdescription { color:#1b4da6; font-family:Arial; font-size:12px; text-align:left; font-weight:normal; width:540px; } .pname /* product name */ { color:#063891; font-family:Arial; font-size:28px; padding:0; } .pdescription /* product description */ { color:#f47720; font-family:Arial; font-size:12px; font-style:italic; text-align:right; padding:0; margin-left:15px; } div.clear /* clear div/container */ { clear:both; } div.fptitle /* featured products title/banner */ { width:540px; height:19px; padding:0; margin:0; } div.fproducts /* featured products small images */ { background-color:#e8e8e8; width:540px; height:76px; padding:0; margin:0; } http://weightlossforever.ca/ Works fine in everything but ie7 the leaves appear in front of their parent, they should be behind it. Thoughts? Please look at this page http://osake.garychus.com/menu2.asp I am trying to wrap a div (red border) around each category on this restaurant menu. For some reason the code looks right but the red border does not enclose the entire category section(s). I validated the html but think the issue is css related. Any help is appreciated. Thanks for taking the time to read my question. I've been searching the web on how to fix this but haven't got anything yet. In IE, my nested div (class="BioContent") stays within the parent container (id="BioBox"), but does not in FF. Right now I am using width: 100%; I've tried defining the width in pixels, but if I get it to work in FF, then it isn't wide enough in IE. Any ideas? Thanks for your help, Brad HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- Created on: 7/21/2006 --> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <title></title> <link href="Junk.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="WP.js"></script> </head> <body> <div id="FaderBar"> <div id="FaderBarWP">Warren Persowich</div> <div><img id="FaderBarImg" src="images/audience.jpg" alt=""></div> <div id="FaderBarHC">Humor Consultant</div> </div> <!--<p/>--> <div id="MainBox"> <div id="LeftBox"> <div id="BioBox"> <div id="Bio0" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[0],0)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[0],0)";>5 Star Rating on bit aired on CBC</div> <div id="Bio1" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[1],1)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[1],1)";>Licenced Psychologist</div> <div id="Bio2" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[2],2)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[2],2)";>National Television Debut - Fall of 2006</div> <div id="Bio3" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[3],3)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[3],3)";>XM Satelite Bit</div> <div id="Bio4" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[4],4)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[4],4)";>Instructor of Stand-Up Comedy</div> <div id="Bio5" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[5],5)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[5],5)";>Manitoba Theatre For Young People</div> <div id="Bio6" class="BioContent" onMouseOver="if (isMouseLeaveOrEnter(event, this)) ShowMediumText(MediumText[6],6)"; onMouseOut="if (isMouseLeaveOrEnter(event, this)) ShowSmallText(SmallText[6],6)";>Cancer Survivor</div> </div> <div id="BioFooter">Move cursor over text to read on...</div> <div id="Broadcast"> <!-- begin embedded WindowsMedia file...--> <OBJECT id='mediaPlayer' width="320" height="285" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="http://servername/path/to/media.file"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="true"> <param name='showControls' value="true"> <param name='loop' value="true"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285" src="http://servername/path/to/media.file" autostart="true" designtimesp='5311' loop="true"> </EMBED> </OBJECT> <!--<a href="http://servername/path/to/media.file" style='font-size: 85%;' target='_blank'>Launch in external player</a>--> </div> </div> <div id="CenterBox"><img class="HeadShot" src="ColourTest1.JPG" width="122" height="212" alt=""/></div> <div id="RightBox"><ul> <li class="LB1TOP"><a href="#">Seminars</a></li> <li class="LB2"><a href="#">Stand-Up</a></li> <li class="LB3"><a href="#">Intro Psych</a></li> <li class="LB4"><a href="#">Selected Transcripts</a></li> <li class="LB3"><a href="#">Broadcast Archives</a></li> <li class="LB2"><a href="#">Links</a></li> <li class="LB1"><a href="#">Pricing & Inquiries</a></li> <!--<li class="LB4"><a href="#">Link #8</a></li> <li class="LB3"><a href="#">Link #9</a></li> <li class="LB2"><a href="#">Link #10</a></li> <li class="LB1"><a href="#">Link #11</a></li>--> </ul></div> </div> <div id="Signature"><a class="Sig" href="#">Manic Web Designs</a></div> </body> </html> CSS: Code: body { /*background: #E2E2E2;*/ background: #000000; margin-top: 5px; } #MainBox { /*background-color: #ECF9FF;*/ background-color: #8C8C8C; margin: 0 auto; width: 780px; /*height: 500px;*/ /*border-color: #004A94; border-width: 2px; border-style: solid;*/ overflow: hidden; } #FaderBar { /*background-color: #ECF9FF;*/ background-color: #8C8C8C; margin: 0 auto; height: 80px; width: 780px; border: 5px double #ffffff; /*background-image:url('HeaderImg.png');*/ } #FaderBarWP { float: left; height: 40px; width: 300px; margin-left: 15px; margin-top: 5px; font-size: 40px; /*background-color: red;*/ } #FaderBarHC { float: left; height: 55px; width: 430px; font-size: 25px; margin-left: 45px; /*background-color: aqua;*/ } #FaderBarImg { float:right; height: 105px; width: 199px; } #LeftBox { width: 340px; /*height: 500px;*/ float: left; /*background-color: aqua;*/ } #CenterBox { width: 220px; /*height: 500px;*/ float: left; /*background-color: red;*/ } #RightBox { width: 220px; /*height: 500px;*/ float: left; /*background-color: yellow;*/ } #BioBox { width: 295px; height: 250px; background-color: #F2F2F2; padding-top: 5px; border-color: #dcdcdc; border-style: solid; border-width: 2px; float: right; margin: 5px 10px 0px 0px; } .BioContent { width: 100%; float: left; font-size: 11px; margin-bottom: 5px; border-top: 1px dashed #dcdcdc; border-bottom: 1px dashed #dcdcdc; padding: 5px; } #BioFooter { float: right; width: 100%; text-align: right; font-size: 12px; color: gray; margin-bottom: 15px; } #Broadcast { height: 300px; width: 330px; float: right; padding: 0px 0px 0px 0px; } ul li { float: right; height: 20px; margin-bottom: 25px; border-color: #dcdcdc; border-width: 2px; border-style: solid; text-align: center; width: 150px; background-color: #F2F2F2; list-style-type: none; } .LB1TOP { margin-right: 30px; margin-top: 35px; } .LB1 { margin-right: 30px; } .LB2 { margin-right: 25px; } .LB3 { margin-right: 20px; } .LB4 { margin-right: 15px; } .LB5 { margin-right: 10px; } .LB6 { margin-right: 5px; } ul li a { display: block; } ul li a:link { text-decoration: none; color: black; } ul li a:visited { text-decoration: none; color: black; } ul li a:hover { background-color: #737373; color: white; font-weight: bold; } ul li a:active { text-decoration: none; } img.HeadShot { margin: 125px 0px 0px 50px; } #Signature { background-color: #E2E2E2; margin: 0 auto; width: 780px; padding-top: 10px; /*height: 500px;*/ /*border-color: #004A94; border-width: 2px; border-style: solid;*/ overflow: hidden; text-align: right; } a.ReadOn:link { text-decoration: none; color: black; } a.ReadOn:visited { text-decoration: none; color: black; } a.ReadOn:hover { text-decoration: none; color: black; } a.ReadOn:active { text-decoration: underline; color: black; } .Sig { color: #808080; font-size: 10px; } a.Sig:link { text-decoration: none; } a.Sig:visited { text-decoration: none; } a.Sig:hover { text-decoration: overline underline; } a.Sig:active { text-decoration: none; } I made a few tables using the old HTML method o setting table attributes. However I later discovered css for tables and wrote the following and it works well with some new tables i have made: Code: table { border-collapse: collapse; border-spacing: 0px; } Now all my old tables follow the above style (quite naturally). How can I override the css styles for the older tables? how do i set border-spacing to its default value? thanks I have like this psudo-code: Code: <div id=parent position: absolute> <div id=child1 position: relative> </div> <div id=child2 position: absolute> </div> </div> As I fill up child1 with text or content, the parent grows along with it. I would like the child2 div to grow along with it as well. That is the concept. Here is the real code: Code: <div style="border: solid 3px; position: absolute; top: 0px; left: 0; width: 300px"> <div style="border: solid green; position: relative; width: 150px"> <p class="bodyCopy"> Lots of text to fill out the div and make it grow. <br/><br/> A lot more text I wish I knew that latin phrase everyone uses to fill out text, better than making stuff up <br/><br/>The next paragraph to make a div grow. <p class="bodyCopy"> Lots of text to fill out the div and make it grow. <br/><br/> A lot more text I wish I knew that latin phrase everyone uses to fill out text, better than making stuff up <br/><br/>The next paragraph to make a div grow. <p class="bodyCopy"> Lots of text to fill out the div and make it grow. <br/><br/> A lot more text I wish I knew that latin phrase everyone uses to fill out text, better than making stuff up <br/><br/>The next paragraph to make a div grow. </div> <div style="position: absolute; top: 0px; right: 0px; height: 100%; width: 10px; border: solid red 3px;"> </div> <div style="border: solid blue 1px; position: absolute; height: 10px; width: 10px; left: 200px; bottom: -14px;"> </div> </div> I also have a test page here This pretty much does what I would expect(or what I want) in FF, but not IE or Opera. I would like this to be dynamic and not use any javascript. Does anyone have any suggestions? Thanks for your time, CJB I have elements in a certain class and they may have child elements. I want to position the child so that it's TOP is at the bottom of the parent. Right now its top is at a fixed place relative to the parent. The parent is variable height. So in my css I have ul.parent ul { top: <bottom of parent> } How do I refre to it? I think I'm having a CSS brain fart here. I'm trying to nest some divs, which is working, but the "helper" won't go where I need it to go. The "helper" is inside the "map" and needs to sit at the bottom of the "map" div because the regular content that appears in there (images) may not be the full height. Currently, the "helper" is sitting just below the image. For example, MAP is 400px tall. HELPER is 98px tall. If there is a picture in MAP that is 213px tall, then there should be 89px between the bottom of the image and HELPER. Here is the code: PHP Code: #content { border:1px solid #000000; margin:0px auto; width:900px; height:402px; text-align:left; } #content #map { float:right; width:302px; height:400px; margin:2px 2px 2px 2px; display:inline; text-align:center; } #content #map #helper { top:300px; width:298px; height:98px; } I've tried position and bottom as well. Those items seem to ignore the dimensions of #map and throw the div at the bottom of the page instead of the bottom of #map. If there is a better way, let me know. I've been searching for a few days, but I haven't found a solution to my problem. How do I get my parent DIV to expand to contain all of my content beyond the viewport? CSS: Code: html { margin: 0px; padding: 0px; height: 100%; width: 100%; min-height: 100%; } body { margin: 0px; padding: 0px; height: 100%; width: 100%; min-height: 100%; } .page { background-color: #dddddd; margin-left: -390px; border-top-width: thin; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-right-style: solid; border-left-style: solid; border-top-color: #9CB0C0; border-right-color: #9CB0C0; border-bottom-color: #9CB0C0; border-left-color: #9CB0C0; position: absolute; height: 100%; min-height: 100%; width: 780px; left: 50%; top: 0; } .header { position: absolute; height: 158px; width: 764px; background-color: #FFFFFF; left: 7px; top: 0px; } .content { position: absolute; left: 7px; top: 159px; background-color: #9CB0C0; height: 821px; width: 764px; margin-bottom: 34px; } .footer { background-color: #415569; height: 34px; width: 764px; left: 7px; bottom: 0px; } And the HTML: Code: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="/test.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> </head> <body> <div id="lPage" style="position:absolute; z-index:1" class="page"> <div id="lContent" style="position:absolute; z-index:2;" class="content"></div> <div id="lHeader" style="position:absolute; z-index:1" class="header"></div> <div id="lfooter" style="position:absolute; z-index:3" class="footer"></div> </div> </body> </html> I've searched through a few of the threads here, but haven't been able to find an answer either. Thanks, Brent Is there a way to style an element's parent with css? I know something like .div1 p { stuff here } takes care of p's that are inside div1 but is there a way to style say any div1 with a div2 inside? Or a ul with a ul inside? |