I have some text styled with the css display:inline-block attribute at the top of a webpage. I used this attribute because it accomplishes the layout goal I want. (The actual code is a bit more complicated than below and the block element enabled it to display properly.)
However, I have now added some javascript and css for a dropdown menu that is supposed to cover over the page underneath. It covers the page underneath except for the above inline-block element that shows through.
Can anyone suggest a way to cover over this element as well.
Here is code I have currently.
javascript and css in header
<style type="text/css">
#results {display: block;
padding: 4px;
position:absolute;
text-align:left;
border-top-style:none;
background-color:white;
opacity:1.0;
filter:alpha(opacity=100);
}
.username {
position:relative;
display: inline-block;
}
</style>
function search() {
//retrieve input from webpage
document.getElementById("results").innerHTML=xmlhttp.responseText; //populate results div
//ajax to get resposetext from serve
}
html
<table>
<tr>
<td>
<input type="text" onkeyup="searh(this.value)">
<div id="results" style="position:absolute"></div>
<div class="username">Username</div>
</td>
</tr>
</table>