CSS - Menu Popup Text....
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. Similar TutorialsHi 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 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 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?? I am using the CSS popup window to check the forms. But I cant find a way on how to make diffrent texts On the CSS Popup Window. I was doing it in the following way: but it was looking kinda dumb to me.. is there a smarter way to do that without needing to write the popupdiv evrytime i got a new text to write? Code: <style type="text/css"> <!-- #blanket { background-color:#111; opacity: 0.65; position:absolute; z-index: 9001; /*ooveeerrrr nine thoussaaaannnd*/ top:0px; left:0px; width:100%; } #popUpDivAlert1{ position:absolute; background-color:#eeeeee; width:300px; height:300px; z-index: 9002; /*ooveeerrrr nine thoussaaaannnd*/ } #popUpDivAlert2 { position:absolute; background-color:#eeeeee; width:300px; height:300px; z-index: 9002; /*ooveeerrrr nine thoussaaaannnd*/ } --> </style> Code: <div id="blanket" style="display:none;"></div> <div id="popUpDivAlert1" style="display:none;"> Alert 1 <a href="#" onclick="popup('popUpDivAlert1')">Click Me To Close</a> </div> <div id="popUpDivAlert2" style="display:none;"> Alert 2 <a href="#" onclick="popup('popUpDivAlert2')">Click Me To Close</a> </div> 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'm having a problem getting the text of an <a> tag to be what I want where I want. No one in the javascript forum wants to tackle this. maybe it is a css thing. I made this interlocking tabbed menu which I do by javascript updating the position of the background graphic and its neighbor. I have done buttons before with a background and text overlayed. but they were always <input>'s and whatever I put in the value field just kinda showed up on top of the background graphic. These are actually <a>'s I assumed the text I put in between the <a> and the </a> tag would just show up but it doesn't. I tried making special divs for them but then I run in to position problems. If I make it absolute the first one is fine, then they all pile on top of it. If I make it relative, NONE of them show. Here is a test http://colleenweb.com/tests/bartest.php There is nothing like css for turning my brain into industrial waste. This has to be doable. Someone who understands this stuff please advise? Hey, i've had this issue for some time now with no resolve... see here I have tried adding a background image to the menu, but to no avail. Here's the menu CSS; Code: #leftmenu { width:150px; min-height:500px; position:relative; left:0; top:1px; background:#e5e5e5 url(images/menu_bg_left.gif) repeat-y; float:left; text-align:left; font-size:8pt; } * html #leftmenu { height:1px; } .lefttop { width:150px; height:40px; background:url(images/menu_top_left.gif) no-repeat; } .leftbottom { width:150px; height:40px; background:url(images/menu_bottom_left.gif) no-repeat; } ul#nav, ul#nav ul { list-style: none; width: 130px; } ul#nav li { position: relative; } li ul.secondary { position: absolute; left: 100%; top: 0; display: none; background-color: #EFEFEF; z-index:400; } ul#nav li a:hover { display: block; text-decoration:none; color:white; background-color:#C4E500; } ul#nav li a { display: block; text-decoration: none; color: #C4E500; padding: 4px; color:#333; border-bottom:1px solid #d1d1d1; } /* Fix IE. Hide from IE Mac \*/ * html ul#nav li { float: left; height: 1%; } * html ul#nav li a { height: 1%; } /* End */ ul#nav li:hover ul, ul#nav li.over ul { display: block; } thanks! Hey everyone. I am new to CSS and the forum, thus slightly overwhelmed with a project I am undertaking to produce a CSS menu. The menu is text based, vertically stacked and has two main criteria: 1. On mouse over one of the text buttons (Work for example) to the right or underneath a hidden DIV appears with a selection of sub options. 2. When the above occurs, the text of the Work menu changes to a specific colour. Eg: Work - HIMALAYAS | LIONS EDITORIAL About Links Blog At the moment I am using the following code to show and hide: <a href="#"onmouseover="showhide('script'); return(false); ">WORK</a> <div style="display: none;" id="script"> <a href="ps">HIMALAYAS</a> <a href="l">LIONS EDITORIAL</a> </div> <script> function showhide(id){ if (document.getElementById){ obj = document.getElementById(id); if (obj.style.display == "none"){ obj.style.display = ""; } else { obj.style.display = "none"; } } } </script> Can anyone help me out? Ray. Any ideas why the text isn't showing up in the main site menu (top left hand side of screen): http://www.thepartyparty.ca Take a look in Firefox and then IE. Firefox works wonderfully (surprise), IE shows no text. Any suggestions? Ryan Hello, I have a vertical menu on the left hand side of my page that I'm working on. I'm trying to center the text vertically in each box as some menu names take up two lines and are skewing the alignment. Here's the code I'm using for the menu: Code: #menu { clear: left; float: left; width: 150px; margin: 0 0 10px 0; padding: 0; font-size: 0.9em; } #menu ul { list-style: none; width: 150px; margin: 0 0 20px 0; padding: 0; font-size: 10px; } #menu li { margin-bottom: 4px; /* space between each menu item */ } #menu li a { /* text */ font-weight: bold; height: 25px; /* height of menu tabs */ text-decoration: none; color: #505050; display: block; padding-left: 10px; padding-top: 5px; background: #f4f4f4; border-left: 4px solid #cccccc; } #menu li a:hover { background: #eaeaea; color: #286ea0; border-left: 4px solid #286ea0; } If anyone could help me out that'd be great. Thanks! Hey folks, strange issue here. despite the fact that i've set the z-index to 400 for the vertical drop down part of the menu, it's still being displayed underneath some of the text in the content part of the page. here's the menu style: Code: #leftmenu { width:150px; min-height:500px; position:relative; left:0; top:1px; background:#e5e5e5 url(images/menu_bg_left.gif) repeat-y; float:left; text-align:left; font-size:8pt; } * html #leftmenu { height:1px; } .lefttop { width:150px; height:40px; background:url(images/menu_top_left.gif) no-repeat; } .leftbottom { width:150px; height:40px; background:url(images/menu_bottom_left.gif) no-repeat; } ul#nav, ul#nav ul { list-style: none; width: 130px; } ul#nav li { position: relative; } li ul.secondary { position: absolute; left: 100%; top: 0; display: none; background-color: #EFEFEF; z-index:400; } ul#nav li a:hover { display: block; text-decoration:none; color:white; background-color:#C4E500; } ul#nav li a { display: block; text-decoration: none; color: #C4E500; padding: 4px; color:#333; border-bottom:1px solid #d1d1d1; } /* Fix IE. Hide from IE Mac \*/ * html ul#nav li { float: left; height: 1%; } * html ul#nav li a { height: 1%; } /* End */ ul#nav li:hover ul, ul#nav li.over ul { display: block; } you can see what i'm talking about here. thanks Hey guys, I searched for this but didn't find an exact answer. I'm working on a really weird navigation header and have run into what should be a really basic problem. I have everything working except for the submenus. I want them to have a red background when rolled over, but white text. No matter what combination I've tried in the code, I cannot achieve this. What gives? You can see what I mean by going he johngibby[dot]com/blbr/ (sorry admins, but it's too complicated to explain without showing it) the CSS is Code: #navbar { margin: 0; padding: 0; height: 1em; } #navbar li { list-style: none; float: left; } #navbar li a { display: block; padding: 0; color: #fff; text-decoration: none; } #navbar li ul { display: none; width: 10em; /* Width to help Opera out */ background-color:#FFF;} #navbar li:hover ul { display: block; position: absolute; margin: 0; padding: 0; } #navbar li:hover li { float: none; } #navbar li:hover li a { background-color: #FFF; color: #000; } #navbar li li a:hover { background-color: #eb1b24;} /*dropdown list item positioning*/ #navbar li.facility { top:-28px; left:73px; position:relative; } #navbar li.membership { top:-90px; left:78px; position:relative; } #navbar li.contact { top:-126px; left:80px; position:relative; } #navbar li.teams { top:-122px; left:360px; position:relative; } #navbar li.camps { top:-85px; left:360px; position:relative; } #navbar li.links { top:-38px; left:360px; position:relative; } #navbar ul.facilitydropdown { position:relative; top:50px; font-family:Verdana, Geneva, sans-serif; font-size:.7em; } #navbar ul.membershipdropdown { position:relative; top:60px; font-family:Verdana, Geneva, sans-serif; font-size:.7em; } #navbar ul.teamsdropdown { position:relative; top:60px; left:-20px; font-family:Verdana, Geneva, sans-serif; font-size:.7em; } #navbar ul.campdropdown { position:relative; top:60px; left:-20px; font-family:Verdana, Geneva, sans-serif; font-size:.7em; } Thanks! Hello, I've always made my menu buttons with the text built into the image but is there a better way to do it? Thanks for the help. I am learning to do drop down menus and so far, so good. What I cannot figure out is that in the drop downs the text seems to be indented. For example, if the text said "New information", the "New" part starts what appears to be a few spaces to the right. I did, most recently, set the text to be centered but it still does this. The effect is that if the text wraps to a second line, then the second line is further to the left. Looks odd to me but I can't figure out how to fix it. Thanks for any help. Richard Hi, I am creating a site with drop down menus, done purely in CSS. If I don't set the 'width' parameter for 'ul' element then in IE7, Firefox and Opera the menu appears fine. In IE6 however the menu just stacks vertically unless I set the width parameter. The reason I don't want to set width is because I would like the top level menu items to just be the length of the text as in IE7 etc. One item is particularly longer than the others and so wastes space. The code for this element: Code: #menu ul { list-style: none; margin: 0; padding: 0; /*change for IE6*/ /*width: 7em;*/ /*stops going onto two lines but then just becomes hidden*/ /*white-space: nowrap;*/ /* width: auto; min-width: 40px; */ float: left; } Is there any way to set the width to be that of the text contained? IE7, Firefox and Opera seem to do this automatically. After extensive searching I have tried auto width, floating in different ways, setting min-width as well as setting no-wrap but no joy. Is there a way to do this, or will I need to configure a set width to make it backwards compatible? Thanks. I have googled; I have read; I have read some more.... </popeye>That's all I can reads and I can't reads no more!</popeye> a {text-decoration:none} YEA! ....now; what if I only want to remove the underline on links in my menu and NOT the whole freakin' document???? lol..sorry I just spent the last three hours trying to fix this and no luck so far. the DOCTYPE is XHTML STRICT. i have a rollover menu that i made with image in a row absolutly positioned. for each button the html code is <div class="art"> <a href="#"> <span class="marginoffset"> Link text here (end tags) and the css is .art {z-index:2;position: absolute; left: 55px; top:0px; display:block; width:600px; height:70px; background: no-repeat 0px 0px; text-indent: -55px; line-height: 14.5em; text-decoration:none; color:#000; font-size:11px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal;} .art a {position: absolute;display:block; background:url(menuimg/btn.art_repro.jpg) no-repeat 0px 0px;line-height: 16.5em; text-align:left; text-decoration:none; text-wrapping: no-wrap; color:#999; font-size:0.7em;font-family: Verdana, Arial, Helvetica, sans-serif;} .art a:hover {position: absolute; background: url(menuimg/btn.art_repro_f2.jpg) no-repeat 0px 0px; line-height: 14.5em; text-align:left; text-decoration:none; color:#000; font-size:11px;font-family: Verdana, Arial, Helvetica, sans-serif;} .art a:active {position: absolute; background: url(menuimg/btn.art_repro_f3.jpg) no-repeat 0px 0px; line-height: 14.5em; text-align:left; text-decoration:none; color:#000; font-size:11px;font-family: Verdana, Arial, Helvetica, sans-serif;} . marginoffset ( position: relative; left: 0px; top:0px; See the image at http://i187.photobucket.com/albums/x205/vitainf/IEhelp.png - having trouble to get it showing the image with the bbcodes :S As you can see the menu to the right, which is known as '.sidebar' in the css followed below, is sort of pushing the main content, which is known as .content in the css below, down. Anyone has any idea how to fix this? Style Sheets Code: body { text-align: center; background: #800000; color: #fff; } * { padding: 0; margin: 0; } div#container { margin-left: auto; margin-right: auto; width: 700px; text-align: left; } #spacer { height: 50px; } #header { height: 100px; width: 100%; background: url(ctfiles/logo.png) no-repeat top center #000; } #container { background: #fff; padding: 10px; } #main { background: #000; color: #fff; width: 700px; } .sidebar { float: right; text-align: right; background: #000; color: #fff; width: 30%; padding-left: 8px padding-right: 12px } .content { color: #fff; background: #000; width: 70%; margin-left: 2px; margin-right: 2px } HTML/Template/PHP w/e Note: It's a template for the MODx CMS, which explains some of the calls like [(site_name)]. The lorum ipsum is in the [*content*] call, the menu in the [[wayfinder...]] one. PHP Code: <!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>[(site_name)] | [*pagetitle*]</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="[(base_url)]chinatown.css" type="text/css" media="screen" /> <base href="[(site_url)]" /> <!--[if lte IE 6]> <style type="text/css" media="screen, tv, projection"> body { behavior: url(assets/js/csshover.htc); } /* hover:anything support */ #content { margin-left: 22px; } /* to avoid the BMH */ a, a:link { border-bottom-style: solid } /* becuase IE just doesn't dot */ </style> <script type="text/javascript" src="assets/js/sleight.js"></script> <![endif]--> </head> <body> <div id="page"> <div id="spacer"> </div> <div id="container"> <div id="header"> </div> <div id="main"> <div class="sidebar"> [[Wayfinder? &startId=`0`]] </div> <div class="content"> <h4>[*longtitle*]</h4> [*#content*] </div> </div> <div id="footer"> [(site_name)] is powered by <a href="http://modxcms.com/" title="Powered by MODx"><strong>MOD</strong>x Content Management System</a> <br /><a href="[~11~]" title="Link to our Blog RSS Feeds">Blog Entries (RSS)</a><br /> MySQL: [^qt^], [^q^] request(s), PHP: [^p^], total: [^t^], document retrieved from [^s^]. </div> </div> </div> </body> </html> Issue resolved using forum search. Thanks for having such great resources - I just had to search for a while. What I'm trying to do is create a menu for an AJAX function in which my content will slide. I don't know need help with the AJAX portion. Where I'm having my trouble is that I want to display four items at a time and then hide the other content to the right of this. When someone would click the button it would slide to left and display the next four elements. I have my four elements and have set a width for them. I am floating these elements left to get them to line up next to each other and I'm using overflow:hidden to hide the content you don't set. What I'm doing wrong is with the width portion. Code: #rightnav { margin-top:14px; background-image:url(../images/loader.gif); background-position:center center; background-repeat:no-repeat; width:282px; overflow:hidden; } #rightnav hr { color:white; background-color:white; height:1px; border:none; width: 250px; margin: 7px auto ; } #rightnav, #wslist, #rslist, #wtlist { height:306px; float:left; } #wslist { background-color:#336699; } .list { width:282px; float:left; } HTML as follows: <div id="rightnav"> <div id="rightbox"> <div id="wslist"> <div id="video"> Word on the Street: <span id="linkIntro">[ <a id="introVid" href="#">Play intro video</a> ]</span> </div> <hr /> <div class="list"> <div id="icon"><img src="images/cam.png" /></div> <div id="vidText"> <p id="vidTitle">Why is my family so screwed up?</p> <p id="vidSub">What to do when families fight</p> </div> <div class="clearfix"><!--cleared--></div> <hr /> <div id="icon"><img src="images/cam.png" /></div> <div id="vidText"> <p id="vidTitle">This my second Title</p> <p id="vidSub">A video on titles</p> </div> <div class="clearfix"><!--cleared--></div> <hr /> <div id="icon"><img src="images/cam.png" /></div> <div id="vidText"> <p id="vidTitle">This is my third title</p> <p id="vidSub">Yay for subtitles, esp ESL</p> </div><div class="clearfix"><!--cleared--></div> <hr /> <div id="icon"><img src="images/cam.png" /></div> <div id="vidText"> <p id="vidTitle">Four titles are great though</p> <p id="vidSub">I am full of English SDH</p> </div><div class="clearfix"><!--cleared--></div> <hr /> </div> <div class="list"> <div id="icon"><img src="images/cam.png" /></div> <div id="vidText"> <p id="vidTitle">I am the outcast of the group</p> <p id="vidSub">Mah.. nobody loves me</p> </div> <div class="clearfix"><!--cleared--></div> <hr /> </div> <div class="clearfix"><!--clear--></div> </div> </div> </div> What I've noticed if I don't put the width property in the div floats to the left as desired. But when I put the width property in and use overflow it just knocks it down below it. Any suggestions? |