CSS - Popup Menu Over Input Boxes
I've been fighting with CSS popup menus for a while now, and finally got everything looking ... close enough ... in every browser at my disposal (even IE). Now, I've started filling my page with content and all hell's breaking loose again. *sigh*
For some background info, this page has a menu at the top, and the content area directly below it. In the content area, I have two divs that generate what's supposed to look like a dialog window. The titlebar div has class "title", the main window area div, class "window" and ID'd "dlg1". The idea being that the "title" div can be clicked to make the "window" div display: none and fold up in a window-shade fashion via a JavaScript function. The script works flawlessly, astonishingly enough, and can be used so that several "dialogs" can exist on the page, independently expandable just by giving them different IDs. Now for the details: The menu is a CSS UL -> LI:hover -> UL { display: block } sort (with a cheat script to make IE a little less retarded.) I've set the z-index of the submenu UL to 1000, hoping nothing in the Z-stack would have a higher display precedence than THAT. Firefox displays everything perfectly. The menus stay on top, the scripts work, life is good. Opera 7 works pretty much the same way. The rollover effects are kind of slow, at least in the Linux version, but no big deal. KDE's Konqueror 3.3.1 has no problem with the title and window divs, but always hides the menu under the <textarea> form element inside the window div. This is not acceptable, but since I will be probably the only one who will use this page in KDE, I can even live with that. MSIE... god bless it... it can't help itself. The menu will draw over the title div, but not the window div. So: 1) Regarding Konqueror's problem, the CSS-over-Flash post below suggests that some elements are too specialized to expect reliable z-index support. Am I to understand that my <textarea> tag will probably never sit correctly in the Z-stack unless the user agent draws them from scratch (like Firefox and Opera seem to do)? ..and, most importantly... 2) Is there ANY reason anyone can see why my menu is weaving behind those divs in IE? Here is a link to all of my content. (It's seperated into a few files to ensure efficient use of the cache, and to make changes easier.) Main CSS file (holds common properties to all pages, regardless of content. Controls the menu, for example.) http://www.mtaonline.net/~nwallette/test/ttmsmain.css Secondary CSS file (holds properties common to all pages that use the window architecture described above.) http://www.mtaonline.net/~nwallette/test/ttmsdlg.css Main JavaScript file (holds code to activate the window-shade function, and some other stuff yet to come.) http://www.mtaonline.net/~nwallette/test/ttmsmain.js MSIE patch JavaScript file (called in an IE conditional statement to fix support for :hover over LI's.) http://www.mtaonline.net/~nwallette/test/stupidie.js ...and finally, the HTML that illustrates the problems. http://www.mtaonline.net/~nwallette/test/argh.html To see what I mean, you'll need to make sure the two "dialogs" are expanded (click on the title bars) and then hover over the Admin menu. Make sure your window size is small enough so the Admin menu dropdown covers part of the dialogs below it. To see the Konqueror problem, contract the first dialog and make sure the 2nd one is expanded, and the Admin menu covers part of the multi-line text box. Any ideas, anyone? Please?? Similar TutorialsNot sure if this is an HTML or CSS related question but here goes... googling gives me nothing. I have a form that I've built and on occasion one or two of the text fields may have text in side them but I've sent the text field to 'disabled' so that the user cannot change the information inside. The problem is is that some of my users are a little bit older and have a hard time seeing what is inside of the disabled text field because its already grayed out and the text inside is gray. Does anyone know if there is a way to change this or is it just a default with internet explorer? Thanks! Hi there, I have this basic CSS: Code: input.text { font-size: 11px; border: 1px #93A6C6 solid; background-color: #FFFFFF; color: #3F5674; font-family: Arial, Helvetica, sans-serif; } select { font-size: 11px; background-color: #FFFFFF; color: #3F5674; padding-right: 3px } textarea { font-size: 11px; border: 1px #93A6C6 solid; background-color: #FFFFFF; color: #3F5674; font-family: Arial, Helvetica, sans-serif; letter-spacing: 0px; word-spacing: 1pt; } The input box style isn't working correctly. The text I type in is coming out black and in a larger font than specified. If I just use style input rather than input.text it does work, but then it will put square borders around radio check boxes, which I don't want. Any ideas why it isn't working? This is the form it is being used on: Code: <form name="Albums Search" method="get" action="searchresults.php"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <input name="searchterm" type="text" tabindex="1" size="50" maxlength="75"> </div></td> <td rowspan="2" align="center" valign="middle"><div align="center"> <input type="submit" value="Search"> </div></td> </tr> <tr> <td><div align="center">Artist: <input name="searchtype" type="radio" value="artist" checked> Title: <input name="searchtype" type="radio" value="title"> Year: <input name="searchtype" type="radio" value="year"> </div></td> </tr> </table> <p> <textarea name="textarea"></textarea> </p> </form> Thanks I recently put a section on my web page that allows people to submit data to database, and it works but it looks kind of plain. And I had seen this web page (http://textsfromlastnight(dot)com/Submit-a-Text.html) and saw how they seem to use a custom text box for their submit form. Can anyone explain to me how they did this? Or if its done with something other than CSS possibly point me in the right direction to learn? Thanks in advance!! Hi, I'm still relatively new to CSS and liquid layouts, so please bear with me. I've made a new layout using only CSS over he http://www.abhiram.astahost.com/trialcss/index.html and the CSS file is: http://www.abhiram.astahost.com/trialcss/mystyle.css Now, when I move the mouse over one of the menu buttons, there should be a popup text that appears below the the button. The problem is, I don't want the button size to increase when you move the mouse over it. This is happening because I've had to use 'position:relative'. Also, I don't want the 'content' and 'rightbar' regions moving down when you mouse over it. I've designed this in 1024x768 res. Any ideas? One way of doing it would be to use absolute positioning, but I want the text to appear below each button. Thanks a lot. Hi all, Thanks for the interest, I want to set my menus like the categories in alibaba.com ( the menu of the left side), on mouse over the sub menus should come up in the same way as here. How can I achieve this ? Thank you guys I found this code online and I'm trying to alter it slightly for what I need. Code: <html> <head> <style type="text/css"> body,html { padding: 0; margin: 10; } #navcontainer ul { list-style-type: none; padding: 0; margin: 0; text-align: center; } #navcontainer ul li { display: inline; } #navcontainer ul li a { text-decoration: none; padding: .2em 1em; color: #fff; background-color: #036; } #navcontainer ul li a:hover { color: #fff; background-color: #acf; } </style> </head> <body> <div id="navcontainer"> <ul> <li><a href="#">Content</a></li> <li><a href="#">Photographs</a></li> <li><a href="#">Events</a></li> <li><a href="#">Estate</a></li> </ul> </div> </body> It gives a nice center-aligned horizontal CSS menu. What I'm wondering is: How do I make it so that the width of each of the blue boxes the links are in are the same width? Say I want them all width: 180px; Where do I put that style so that it applies to all the links? [On a related issue, the style sheet has 4 things related to #navcontainer. How does one know which one of these to put additional styles in?] Thanks Much. j 9 Dear clever CSSers I am currently changing my flyout menu from something rather complex, to the Suckerfish version. I have one problem: I have been using some mouseover tooltip-like information boxes giving extra details of the contents of a link, by having a div within the text of the hyperlink, to come visible when hovered. It has worked very well in my old version. Here's my test page In the new version, there are two lines of CSS allowing the popup to open, which is also enclosed in a balloon-style info graphic, actually in two halves so that it can open like a clamshell if there is extra text in there, or a user has a larger than normal font setting: Code: #nav a span {visibility:hidden;position:absolute;top:-120px;left:175px;background: url(http://www.internetevangelismday.com/images/balloontop.png) no-repeat transparent top left;width:196px;height:105px;line-height:1.2em;text-align:left;word-wrap:break-word;text-wrap:normal;white-space:normal;padding:0px;} #nav a:hover span {visibility:visible;z-index:9999;min-height:130px;} This CSS does allow the popup to appear, but unfortunately it positions each popup at the same position on the page. I would prefer it that they appeared with the 'point' of the balloon pointing at the relavent link. You can see that if you hover '2nd level here', and then 'page 1', or 'page 2' or 'another page', the info balloon appears in exactly the same place on the page. Changing the positioning from position absolute to position relative causes the popup to appear in about the correct position, but it also expands the link area on the menu itself to a huge blank area and misses off the balloontop.png graphic from the popup, which I presume is staying inserted, hidden, within the menu item and causing it to expand. Thanks for any ideas on this. BTW, the javascript is a neat one that repositions submenus where necessary so they can't vanish below the bottom of the page. Best wishes Tony Hi all, Im having a great deal of problem trying to get a CSS based autocomplete menu appear above input fields (not select) in IE 7 only. Have tested in Firefox, Safari, Opera etec and it looks good. Am totally stumped on this so any help much appreciated, kind regards matt See here the live version: jsfiddle.net/nrWug i want that the menu in the popup is binded ondrag or onresize to the outer popup. How can i bind these two to make the dialog draggable and resizable? thanks for your time. I get this error from XML-CSS validation. The element type "input" must be terminated by the matching end-tag "</input>". I'd like to know where it goes. It is this form: <form action="send_survey_results.php" method="POST"> Name: <input type="text" name="user" SIZE="30"><br> e-Mail: <input type="text" name="email" size="30"><br> Interests:<br> <input type="checkbox" name="intere<input type="submit" value="Register"> ------------additional boxes here------------------ <input type="reset" value="Clear Form"> </form> </div>sts[]" value="clothes">Clothes Thank you, Ed Hello, I created a site with floating frames and it looks good in IE6 and FF/Mozilla. But I have one problem: I use in my dynamic layout an ID more then once (thats not OK according w3 validation) I tried to do something with pseudo classes but this works not really goed. My "uni" thumb box is used on two diff. pages The skyscraper: http://www.all4yourwebsite.com/ and the result/search page: http://www.all4yourwebsite.com/search.php I know there is a solution, but because the tumbbox have to be much flexible the solution must be simple as the current (wrong) solution. Anyone an idea? hi, Im making a site, and i decided to use CSS instead of tables. I have used basic CSS before, but it gets abit harder when i start making boxes etc. Here is my code so far - layout.css - (one that gets included on each page) Code: @import "style.css"; body { margin:10px 10px 0px 10px; padding:0px; } #leftcontent { position: absolute; left:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #centercontent { background:#fff; margin-left: 199px; margin-right:199px; border:1px solid #000; voice-family: "\"}\""; voice-family: inherit; margin-left: 201px; margin-right:201px; } #shoutbox { position: absolute; right:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #rightcontent { position: absolute; right:10px; top:50px; width:200px; background:#fff; border:1px solid #000; } #banner, #footer { background:#fff; height:40px; border-top:1px solid #000; border-left:1px solid #000; border-right:1px solid #000; voice-family: "\"}\""; voice-family: inherit; height:39px; } #footer { background:#fff; height:40px; border-bottom:1px solid #000; border-left:1px solid #000; border-right:1px solid #000; voice-family: "\"}\""; voice-family: inherit; height:39px; } #banner h1 { font-size:16px; padding:10px 10px 0px 10px; margin:0px; } #shoutbox, #rightcontent p { font-size:10px } style.css - text formatting etc. Code: body { font: 12px/1.2 Tahoma; background:#ddd; padding:0px; margin:0px; } a { text-decoration:none; font-weight:bold; color:#c00; } pre { font-size:11px; color:blue; } ol { margin-right:40px; } li { margin-bottom:10px; } p,h1,pre { margin:0px 10px 10px 10px; } h1 { font-size:14px; padding-top:10px; } it produces a good layout, with a header, 3 coloums and a footer. whoever, the boxes expand at different rates and the footer doesnt move down. the header also doesnt expand. i know how i can fix this, but i dont know how to fix it without making it so that its locked at a resolution. i would like the site to exapand as the window is made larger. here is an image of what i get - and this is what i am aiming to acheive - as you can see, i want all the boxes to be the same length, which is defined by the size of the largest box. also, i want to create 2 or more boxes on the left, only the bottom of which gets made longer. on the first image you cannot see the extra box because it is covered by the other one :-/ i would be greatful for any help you guys can provide me thanks, dynamyt Hello: I'm trying to place two drop down boxes at the right of my page. When I view the pages in Firefox and Internet Explorer, they are so far off. You can view the page yourself by visiting: http://www.informedmortgage/100-financing.html I've tried changing widths, margins, etc and am having no luck. I can use some help. I hope someone can help me out. Thank you. Back to top Hi I am creating a new site for a friend in Wordpress ilovelifebecause.com I can usually muddle through in css to make changes, but i'm stumped at the moment. What I am trying to do is swap around the two cream coloured boxes so the larger one is on the right, the thinner one on the left and the blue box in the middle still. I've tried a number of things in the css file but can't seem to find the right method - can anyone help? many thanks in advance Paul Hallo, I have in several cases serious problems with floating boxes. Not with the standard layout's like here described http://css.maxdesign.com.au/floatutorial/ but with more complicated layouts. I know to place the float attribute but have problems with setting the clear attribute. Does some know a good source where I find more information or documented examples ? Finally I can fix my problems, but it take so much time of testing... Thnaks Hi guys, I am trying to achieve the following: Box 1 | ------ Box 2 | ** With a 3rd box to the right of box 1&2 I have got this far but cant work out how to do 'box2' Code: <div id="box2"> box 2 </div> <div id="box3"> box 3 </div> Code: #box2 { float: left; padding: 10px; margin: 20px; background: #ffffff; width: 100px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 100px; } html>body #box2 { width: 100px; /* ie5win fudge ends */ } #box3 { float: right; padding: 10px; margin: 20px; background: #ffffff; width: 100px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 100px; } html>body #box3 { width: 100px; /* ie5win fudge ends */ } Can anyone possibly help? My boxes line up horizontally perfectly in Firefox but not in IE7 (not suprisingly). Because of the rules I can't show you the link but the html places two boxes side by side lined up so that they are the same distance from the top. It looks right in Firefox but IE7 drops the right box about 10 pixels or so. My Html is this: <div id="newsboxleft"> <div id="newsboxright"></div></div> My CSS is this: #newsboxleft { margin: 10px auto; position: relative; top: 0px; left: -187px; width: 350px; height: 142px; background: url(../images/newsboxleft.jpg) repeat-x top; border-top: 0px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; padding: 0px; clear: both; } #newsboxright { margin: 10px auto; position: relative; top: 0px; left: 373px; width: 350px; height: 142px; background: url(../images/newsboxright.jpg) repeat-x top; border-top: 0px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; padding: 0px; clear: both; } I hope someone can help. Thanks. Im trying to replicate the vertical navigation style that is used on the Mozilla Firefox Website (as seen to the left). I have sucessfully done this useing images, with the exclusion of a space problem between the items and the end images in FireFox. I am using the strict.dtd and am frustrated with this problem. Iff anyone can help me create a nav with this style that would be wonderful. Here is the css im using: Code: .cssnavend { position:relative; font-family: arial, verdana, helvetica, sans-serif; display: block; width: 209px; height: 9px; margin: 0; margin-bottom:0px; padding: 0; } .cssnav { position:relative; font-family: arial, verdana, helvetica, sans-serif; background-image: url(images/but-over.jpg); background-repeat: no-repeat; display: block; width: 209px; height: 31px; margin: 0; margin-bottom:0px; padding: 0; } .cssnav a { display:block; font-size: 11px; width: 209px; height: 31px; display: block; float: left; margin: 0; padding: 0; color: #096CCE; text-decoration: none; } .cssnav img { width: 100%; height: 100%; border: 0; } .cssnav a:hover{ color: #000; } * html a:hover { visibility:visible } .cssnav a:hover img{ visibility:hidden } .cssnav span { position:absolute; left:7px; top:7px; margin:0; cursor: pointer; } #box { margin-top: 10px; padding: 0; width: 209px; display: block; } #boxtop { width: 209px; height: 11px; } #boxcontent { width: 209px; background: #DFE5EB; } #boxbottom { width: 209px; height: 11px; } #boxtext { width: 209px; background: #DFE5EB; padding: 2px; } The following code is me testing my css. The first group is useing the cssnav styles. The 2nd group is using the box styles. The 3rd group is a try at making a content box with rounded corners that is a spacific width. Unfortunatly, the content of the box will not wrap to the width of the box, instead it continues on 1 line and outside the box. Code: <div class="cssnavend"><img src="images/but-top.jpg"></div> <div class="cssnav"><a href="index.php"><img src="images/but-up.jpg" /><span>Home</span></a></div> <div class="cssnav"><a href="#"><img src="images/but-up.jpg" /><span>This is a test</span></a></div> <div class="cssnav"><a href="phpbb/index.php" target=_blank><img src="images/but-up.jpg" /><span>Forum</span></a></div> <div class="cssnavend"><img src="images/but-bot.jpg"></div> <br><br> <div class="box"> <div class="boxtop"><img src=images/but-top.jpg></div> <div content="boxcontent"> <div class="cssnav"><a href="#"><img src="images/but-up.jpg" /><span>Home</span></a></div> <div class="cssnav"><a href="#"><img src="images/but-up.jpg" /><span>This is a test</span></a></div> <div class="cssnav"><a href="#"><img src="images/but-up.jpg" /><span>Forum</span></a></div> </div> <div class="boxbottom"><img src=images/but-bot.jpg></div> </div> <br><br> <div class="box"> <div class="boxtop"><img src=images/box-top.jpg></div> <div class="boxcontent"> <div class="boxtext">This is some text inside of the box. This text should wrap and be padded.</div> </div> <div class="boxbottom"><img src=images/box-bot.jpg></div> </div> Thank you all who help. I have 4 or 5 form controls that I want in a horizontal line. Each form control has a label above it, and I'm using <br>s to position the form control below the label. I thought that wrapping each "label<br>form control" with a <span> would turn the whole thing into an inline block, where the next <span> would line up next to it, like the next <td> in a <tr>. Code: <div id=secondline> <span id=ed> <b>Event Definition</b>:<br> <textarea name=inject cols=45 rows=6></textarea> </span> <span id=after> <b>After</b><br> <select name=next size=8 multiple> <option value=0>0 ... <option value=100>100 </select> </span> </div> but, alas, it doesn't work like that. How can I get Code: <tr> <td>label<br>form_control</td> <td>label<br>form_control</td> </tr> behavior without using tables? Hey guys, This seems like a really simple thing to accomplish, but I'm just having trouble locking on to what exactly to put in the code. Basically, I want to have two rows of four horizontal boxes, with the two rows of boxes and the contents of each box centered. How do I go about doing this? Should I use <span> for each box and then just use absolute positioning? Or should I put them in a container <div> or something? If anybody has any code samples, that would be a big help. I just want it to end up looking like this: [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] ...with all the boxes centered on the page. Thanks for the help! - Luke |