Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Alright! Here is what we got.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en-us"&gt; &lt;head&gt; &lt;title&gt;IE7 Absolutely Positioned Element Issue&lt;/title&gt; &lt;style type="text/css"&gt; * { font-family: Tahoma; font-size: 8pt; padding: 0; margin: 0; border: 0 none; z-index:1;} /* z-index to 1 for everything*/ div.section { width: 400px; margin: 0 auto; border: 1px solid #444444; margin-top: 5px; } div.toggleBrowseMenu { cursor: pointer; padding-left: 5px; position: relative;} div.browseMenu { border: 1px solid #E2E2E2; position: absolute; width: auto; height: auto; left: -3px; top: 19px; padding: 0px; background-color: #FFFFFF; display: none; text-align: left; z-index: 10; } /*set z-index to 10 here! */ div.browseMenu ul { list-style-type: none; } div.browseMenu li { background-color: green; padding: 3px 7px; margin: 0px; white-space: nowrap; } div.browseMenu li:hover { text-decoration: underline; } &lt;/style&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="section"&gt; &lt;!-- you didn't this to be relatively positioned --&gt; &lt;div style="float: left; padding-left: 100px;"&gt; Left Content &lt;/div&gt; &lt;div class="toggleBrowseMenu" style="float: right; padding-right: 100px;"&gt; Browse &lt;div class="browseMenu"&gt; &lt;ul&gt; &lt;a href="http://www.google.com/"&gt;&lt;li&gt;Google&lt;/li&gt;&lt;/a&gt; &lt;a href="http://www.yahoo.com/"&gt;&lt;li&gt;Yahoo&lt;/li&gt;&lt;/a&gt; &lt;a href="http://www.bing.com/"&gt;&lt;li&gt;Bing&lt;/li&gt;&lt;/a&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="clear: both;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="section"&gt;&lt;!-- removed wrapping div with relative positioning here--&gt; &lt;div style="float: left; width: 40%; padding: 5%;"&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque at augue at tellus tristique porta. Nulla rhoncus tincidunt turpis, eu mattis dui scelerisque in. Vivamus lectus velit, consectetur at pellentesque dignissim, faucibus id lacus. Aliquam ut eros at erat convallis tincidunt id vel velit. Pellentesque commodo, nulla sed malesuada convallis, ipsum nulla viverra lorem, et mattis sapien nibh nec magna. Donec a nibh ligula. Suspendisse at convallis libero. Phasellus cursus nibh at mi aliquet venenatis. Donec non tortor vitae sapien facilisis imperdiet. Proin molestie tempor dapibus. Suspendisse potenti. Nulla facilisi. Suspendisse risus est, faucibus sit amet laoreet in, cursus ut augue. Cras mollis venenatis est, nec vehicula massa pellentesque et. &lt;/div&gt; &lt;div style="background-color:red; float: left; width: 40%; padding: 5%;"&gt; Fusce adipiscing odio quis massa placerat euismod. In eu eros orci. Aenean mollis luctus velit ac sollicitudin. Cras elit erat, semper quis fringilla ac, placerat sed justo. Duis sed tellus risus, fermentum pellentesque nunc. Phasellus mollis tempus eros, posuere dictum augue gravida at. Praesent sollicitudin justo ac purus iaculis auctor. Suspendisse potenti. Praesent vehicula fermentum sem in ullamcorper. Donec pharetra ante vitae urna pharetra dignissim. Suspendisse tincidunt felis elementum lorem imperdiet ullamcorper. In malesuada, arcu a porta tincidunt, nisl elit pulvinar lacus, in dictum velit odio eget risus. Integer cursus dapibus tortor ut congue. Nunc mattis mollis justo. Aliquam quis tellus tellus, eu sagittis tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. &lt;/div&gt; &lt;div style="clear: both;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; // Toggle the browse menu. $('.toggleBrowseMenu').click(function () { $('.browseMenu').toggle(); }); // Hide the browse menu when the mouse leaves the tag. $('.browseMenu').mouseleave(function () { $(this).hide(); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now, don't quote me on this solution because I am only using an IE7 tester, not actual IE7, but it usually works out for me. Currently, I changed your right section background-color to red. You can fix that.</p> <p>What was wrong was, you had an extra div wrapping your section class containing the content with a "position:relative" for styling. The div was unnamed, and therefore could not be referenced with a stylesheet, so I deleted it. Also, in the first section div class you misspelled relative how I completely removed it, because you don't need it. I set every items z-index to 1 initially and upped your z-index on the .browsemenu class to 10. Also, the paragraph where "Fusce adipi...." starts, the div wrapping that randomly contained the word peach in the style referencing.</p> <p>I made comments for all my edits. Good luck and I hope this helped.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload