CSS - Ie Child Element Hover Bug?
I have a couple of divs that slide out from the side of the browser window when the user hovers over a button which is sticking out from that div.
This is easily accomplished in every browser except for IE. The problem is that there is other elements inside this div and when the mouse hovers over these other elements the slide out div goes back off the screen, because it thinks the mouse is no longer over the div when in fact it is. Has anyone ever ran into a problem like this and know how to fix it. Similar TutorialsPlease look at this page - http://www.soarminden.com/glider-soaring-gallery.asp I put a red border on parent element. The children divs appear outside the parent at page bottom? Can someone shed some light please? I think the issue is with the styling of the div(s) innerLeftColumn or LeftColumn Code: <div style='width:670px;margin:0;border:1px solid red;min-height:500px;position:relative;'> <div style='width:175px;height:150px;float:left;margin:20px 0 20px 10px;clear:left;'> <img src='images/gallery/1/tom6.jpg' style='width:175px;height:150px;margin-bottom:3px;'/><br /> <h4 style='text-align:center;font-size:12px;margin:0;padding-bottom:10px'><a href='glider-soaring-gallery2.asp?subject=1' style='color:#00f;line-height:1;text-decoration:undeline !important;'>Tom Hall Soaring</a></h4> </div> <div style='width:175px;height:150px;float:left;margin:20px 0 20px 10px;'> <img src='images/gallery/12/phil-jones2.jpg' style='width:175px;height:150px;margin-bottom:3px;'/><br /> <h4 style='text-align:center;font-size:12px;margin:0;padding-bottom:10px'><a href='glider-soaring-gallery2.asp?subject=12' style='color:#00f;line-height:1;text-decoration:undeline !important;'>Phil Jones Goes Gold & Diamond!</a></h4> </div> <div style='width:175px;height:150px;float:left;margin:20px 0 20px 10px;'> <img src='images/gallery/13/wedding1.jpg' style='width:175px;height:150px;margin-bottom:3px;'/><br /> <h4 style='text-align:center;font-size:12px;margin:0;padding-bottom:10px'><a href='glider-soaring-gallery2.asp?subject=13' style='color:#00f;line-height:1;text-decoration:undeline !important;'>Wolfram and Lydia's Wedding</a></h4> </div> <div style='width:175px;height:150px;float:left;margin:20px 0 20px 10px;clear:left;'> <img src='images/gallery/15/DSC_6547.jpg' style='width:175px;height:150px;margin-bottom:3px;'/><br /> <h4 style='text-align:center;font-size:12px;margin:0;padding-bottom:10px'><a href='glider-soaring-gallery2.asp?subject=15' style='color:#00f;line-height:1;text-decoration:undeline !important;'>Brennan Hall Soaring Lake Tahoe</a></h4> </div> <div style='width:175px;height:150px;float:left;margin:20px 0 20px 10px;'> <img src='images/gallery/16/teresa.jpg' style='width:175px;height:150px;margin-bottom:3px;'/><br /> <h4 style='text-align:center;font-size:12px;margin:0;padding-bottom:10px'><a href='glider-soaring-gallery2.asp?subject=16' style='color:#00f;line-height:1;text-decoration:undeline !important;'>Teresa Luther</a></h4> </div> </div> I can't figure out why the ul with the id #two is not responding to my position attempt. It is child of an li in the ul w/ a class .menu on www.eagletransmission.net If you mouse over Gallery the dropdown should be flush with the left side of the parent li but it is not. Aaaaargh Tom Hi there, Need some CSS guru help. If you visit my link: http://www.gabbr.com/js/viewer/cmedata/index1.html and hover over the years (top middles, 2008, 2009, 2010, etc) you will notice an orange bar extending from the top to the bottom of the page. I am trying to get the same effect on the left (month and day) but am unable to do so. The problem I am having is that I cannot get the orange hover bar to extend off the left of the screen for either #dayleft or for #monthleft. It extends all the way to the right margin of the screen but not the left. The problem is the margin-left: 15px; in #monthleft and margin-left: 80px; in #dayleft. But I cannot get rid of these since I require them for the letter spacing. Any advice? I've been getting quite confused as to why some CSS wasn't doing what I'd expected it to do. I have code like this: Code: .tBox { width: 50px; height: 50px; } .tHeader { opacity: 1 } .tBox:hover .tHeader { opacity: 0.5 } I then have my DIVs like this (simplified) Code: <div class="holder"> <div class="section1"> <div class="tBox"> </div> </div> <div class="section2"> <div class="tHeader"></div> </div> </div> So what I was expecting to happen is that when someone hovered over "tBox" then "tHeader" would switch opacity. But it wasn't. And I believe this is because tBox and tHeader aren't in the same parent. I read somewhere something about using a "+" to do some special selector stuff in the CSS but didn't really understand. Can someone please help me with how I can get this to work outside of them sharing their parent. Thanks. I know how to do this using Javascript, but I'm not sure if it can be done using CSS itself. I have a bunch if div tags and some anchor tags on my page. By default, the div tags are hidden, and when I mouseover an anchor, I would like a specific div to be displayed. Again, I can do this in Javascript, but would like to see if there is a CSS-only approach to this. Example HTML: Code: <div id="div1">Option1</div> <div id="div2">Option 2</div> <div id="div3">Option 3</div> <a id="link1" href="somepage.html"></a> <a id="link2" href="someotherpage.html"></a> <a id="link3" href="someotherpageentirely.html"></a> Example CSS: Code: div#div1 div#div2 div#div3 { display:none; width:50px; height:50px; background-image: url(divimage.png); } a#link1 a#link2 a#link3 { display:block; width:100px; height:100px; background-image: url(myimage.png); } a#link1:hover a#link2:hover a#link3:hover { display:block; width:120px; height:120px; background-image: url(myotherimage.png); } So in this instance, when one of the anchor tags is hovered over, I would like to change the associated (link1 -> div1, link2 -> div2, link3 -> div3) div CSS to change to be something like this: Code: div#div1 { display:block; } I realize I've generalized these CSS definitions and on my actual page I have individual CSS definitions for each anchor and div separately as they all differ slightly. Is there a way to do this using straight CSS or am I bound to Javascript in order to do this? Thanks! - skubik I'm basically asking the same question as this post, but hoping that I can press for a better solution. I have an element which contains an image and some text, and I need that element to expand to the width of the image, not the text. The size of the image will change, so I can't set a fixed width on the containing element. The code I have which doesn't work looks like this: Code: <html> <head> </head> <body> <span style="display: inline-block; border: 1px solid black"> <img src="someimage.jpg" style="width: 400px; height: 200px;" /> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel placerat sapien. Aenean tempus lorem justo, at eleifend mi. Nam elementum nisl ut elit blandit dapibus. Donec et massa turpis, ac tincidunt odio.</div> </span> </body> </html> The solution proposed in the post I linked to looks like this: Code: <html> <head> </head> <body> <table width="1"> <tr> <td> <img src="someimage.jpg" style="width: 400px; height: 200px;" /> </td> </tr> <tr> <td> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel placerat sapien. Aenean tempus lorem justo, at eleifend mi. Nam elementum nisl ut elit blandit dapibus. Donec et massa turpis, ac tincidunt odio. </td> </tr> </table> </body> </html> The second example gives me the functionality I'm looking for, but I would really like to avoid using tables. I'm hoping there is a CSS solution to this. Thanks. Just like the title says, the child is wider than the parent, and i want it automatically centered, so t hat the centers of both divs are inline with each other. I tried the Code: margin 0px auto; which works if the child is smaller, but it doesn't seem to work in this case, any other ideas? Hi, My page has 3 elements: one at the top(header banner), one in the middle (a middle content area) and one at the bottom (footer banner). Now I want those positions to remain intact regardless of the number of lines output in the middle element. The content is going to be determined at runtime by a server-side routine so I don't want to use a fixed positioning for the footer banner. I want it to be displayed at the bottom - after the middle content is displayed. And I want the middle content to be visible in the page i.e. I don't want a scroll area within the page. I have tried various approaches and read up on positioning but so far have not been able to do it using css. Any help is much appreciated. Jim I have an navigation menu that I am building as an unordered list. What I have is an image rollover that appears at the bottom of the navigation menu when the cursor hovers over one of the first level links by using a span within the link that has its display set to none, and then set to absolute positioned directly below the navigation menu on a:hover. Here is an example: Code: <ul> <li> <a href="link1.html" id="link1">Link<span></span></a> </li> </ul> .link a { some link height } .link a span { display: none; } .link a:hover span { position: abolute; top: (some link height * the number of links); background-image: (some image url) width: (image width) height: (image height) } Appearance: ------ Link1 Link2 Link3 Link4 ------- ------- Rollover Image to appear here ------- The problem that I have is that since the rollover image is positioned absolutely, if the size of the list of links changes (IE with sub-links in the list) it slides under or over where I have the rollover image placed. IE ------ Link1 sublink1 sublink2 Link2 Link3 Link4 ------- will break my scheme. Is there a way to get the span within the link to show up relative to the bottom of the <ul> element, or at the bottom of an element that contains the whole shebang? If I cant get this to work, I'm going to be forced to adopt the existing tables/javascript based template for our site, and I'd hate hate hate to do that. thanks. I have a drop down menu located at http://www.fieldspianos.com/new/index.php If you hover over the menu items they turn black and white when you are right on the text but not if you are in the area surrounding it which is what I also need to occur. You can view the source on the page for the html but I will include the css below. This is the basic layout of the menu: Code: <ul> <li>About Us</li> <ul> <li><a href="#">Locations</a></li> etc..etc..etc.. Here is the css: Code: /*Begin Content of drop down menu*/ a { outline:none; } * html div#dropdownmenu ul { float: left; } * { margin: 0; padding: 0; } div#dropdownmenu { float: left; background-color: #C8C6C6; font-size:11px; font-family: Verdana, Arial, Helvetica, sans-serif; } div#dropdownmenu ul li { list-style-type: none; float: left; background-color: #000000; position: relative; } div#dropdownmenu ul li:hover { list-style-type: none; background-color: #000000; } /*Hides drop downs when not overed over and reveals them when they are hovered over.*/ body div#dropdownmenu ul li ul { display: none; } body div#dropdownmenu ul li:hover ul { display: block; } div#dropdownmenu ul li ul { margin: 0; width: 13em; position: absolute; left: -1px; } div#dropdownmenu ul li ul li { width: 100%; background-color:#bdb35e; color: #660000; border-bottom: 1px solid #000; border-left: 1px solid #000; border-right: 1px solid #000; padding: 3px; } div#dropdownmenu ul li ul li:first-child { border-top: 1px solid #000; } div#dropdownmenu ul li ul li:hover { color: #FFFFFF; background-color: #000000; } div#dropdownmenu ul li ul li a { color: #660000; text-decoration:none; outline: none; } div#dropdownmenu ul li ul li a:hover { color: #FFFFFF; background-color: #000000; text-decoration:none; outline: none; } div#dropdownmenu ul li:hover ul, div#dropdownmenu ul li ul:hover { display: block; } Any help is greatly appreciated, this seems like it would be a simple fix but I can't figure it out. Maybe I am overlooking some small detail. Thanks! Can anyone explain the difference between the two? For example, what is the difference between: this: element element {} div p { } and this: element > element { } div > p { } I don't understand it and have not found an explanation in tireless searching. Thx! How do I distinguish <li> that have child from the one that does not in an unordered list, using CSS? Hey, all! I'm having a seemingly simple problem... and I'd really appreciate if you guys could help me out! I have no idea how to do what I want done, but I know it's possible. I want to give every <tr> in <table class="forumList"> a 'border-bottom: 1px solid #000;' style.... except for the last <tr>. HOWEVER, if a new table is created, I want it to start showing the border-bottom again... until the last <tr> in the table. How would I go about doing this? Is there any way to change the background image of an element that is inside the current one? Kinda like this.child.style.backgroundImage = ""? Not sure if this would be more of a javascript question, if so sorry. I have an a tag with an ID and I want to change the background position of the child element which is an input button Code: <a href="javascript:;" id="buttonLeft" class="fromButtInput" onMouseOver="buttHover(this)" onMouseOut="buttOff(this)" > <input type="submit" id="buttonRight" value="Submit" border="0" /> </a> The "buttHover(this)" offsets the background image of the a tag. I can't figure out how to target the <input> inside without affecting all the other buttons. I have the following code: Code: <div class="Outer"> <div class="Inner"> Text one </div> </div> <div class="Outer"> <div class="Inner"> Text two </div> </div> I have the following CSS Code: .Outer{ width:150px; float:left; } .Inner{ Margin:10px: } I would like to set the Inner div in first instance of Outer to have a margin-left of 0px. I have tried the following Code: .Outer:first-child .Inner{ margin-left:0px; } This works in Chrome but not in IE, but it does work if I apply the style inline to the First Inner Div. Can it be done within the CSS file? I wrote a little div based expandable tree but am having trouble setting some of the conditional styling when a div has children. What I'd like, is that when a div has children, the "font-weight" should be set to bold. Ideally, I'd also like to use the "div:after" property to append a '>' indicating that the div has children, but that's not critical. I tried the following but it didn't work right: Code: /* Styles the child, not the parent */ div.tnode > .tnode { display: none; font-weight: bold; } /* Doesn't do anything */ div.tnode:after > .tnode { content: '>'; } And here's the basic css with html Code: <html> <head> <style> /* Node container styles */ div.tcontainer { width: auto; height: auto; font-family: Lucida Grande, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; font-size: 12; color: black; padding: 5 5 5 30; } /* Node styles */ div.tnode { display: inherit; padding: inherit; } div.tnode:hover { cursor: pointer; } /* Node child styles */ div.tnode > .tnode { display: none; font-weight: bold; } div.tnode:hover > .tnode { display: block; } /* doesn't work div.tnode:after > .tnode { content: '>'; } */ </style> </head> <body> <div class='tcontainer'> <div class='tnode'>North America <div class='tnode'>USA <div class='tnode'><img src='http://images.infoplease.com/images/states_imgmap.gif' /></div> <div class='tnode'>States/Provences</div> </div> <div class='tnode'>Canada <div class='tnode'><img src='http://www.infoplease.com/images/mapcanada.gif' /></div> <div class='tnode'>States/Provences</div> </div> <div class='tnode'>Mexico <div class='tnode'><img src='http://www.infoplease.com/images/mmexico.gif' /></div> <div class='tnode'>States/Provences</div> </div> </div> </div> </body> </html> Any help appreciated Thanks Ken Hi, i am trying to get first-child to work in ie7 but i am not sure why it wont recognise it or overwrite the css. it works fine in every other browser apart from ie7: Code: <div id="container"> <h4></h4> <p></p> <h4></h4> <p></p> </div> what i am trying to do is remove the border-top on my first h4. i have tried many different variations: Code: #news-container h4:first-child { border-top: none; } i have also added first-child to my parent div but that still wont solve it. could some one please advise me where i am going wrong. thanks in advance I was just wondering if there was an alternative other than adding a last class to the last element in a list for internet explorer. To explain the situation, I have a navigation list in a ul: Code: <div id="navigation"> <ul> <li><a href="/" title="Homepage">Home</a></li> <li><a href="/" title="Homepage">About</a></li> <li><a href="/" title="Homepage">News</a></li> <li><a href="/" title="Homepage">Contact</a></li> </ul> </div> <!-- navigation --> To get the look I want, tiled vertically with a white line in between elements, I am applying this style Code: div#navigation { width: 200px; margin: 0 0 0 10px; float: left; } div#navigation ul { list-style-type: none; margin: 0; padding: 0;} div#navigation ul li { background: #585858; border-bottom: 2px solid #e4eaef; padding: 0; } div#navigation ul li a { display: block; color: #e4eaef; text-decoration: none; padding: 6px; } div#navigation ul li a:hover { background: #fab511; display: block; color: #2c2c2c; text-decoration: none; } /* only works in Mozilla */ div#navigation ul li:last-child { background: #585858; border-bottom: none; } but of course the last-child pseudo class does not work in IE. Just curious. Also, what is the fix for the anchor element not expanding to the full width of the list item? http://weightlossforever.ca/ Works fine in everything but ie7 the leaves appear in front of their parent, they should be behind it. Thoughts? I have a typical suckerfish men that I am using but on the second level I am putting a left border around each list element. However, for Firefox I used the first-child pseudo selector but that will not work for Internet Explorer 6 and for some reason the alternative I'm using is not working. Here is the layout of my suckerfish menu. Code: <div id="menu"> <ul id="nav"> <li class="option1">Option 1 <ul class="secondlevel"> <li class="first">Option A</li> <li>Option B</li> <li>Option C</li> </ul> </li> <li class="option2">Option 2 <ul class="secondlevel"> <li class="first">Option A</li> <li>Option B</li> </ul> </li> <li class="option3">Option 3 <ul class="secondlevel"> <li class="first">Option A</li> </ul> </li> <li class="option4">Option 4 <ul class="secondlevel"> <li class="first">Option A</li> <li>Option B</li> </ul> </li> </ul> </div> To reference the first child I should be able to call the class called first. So this is what I have and it doesn't work Code: ul#nav li.first { border-left-style: none; } Any help would be greatly appreciated, thanks, teamhonda81 |