CSS - Links Bleeding Through Css Tooltips
Hello,
I have [almost] successfully added CSS tooltips to a conference agenda and have an issue where links are "bleeding" through the tooltips. I think it has something to do with the way the links and tooltips are positioned. For example, I have a table cell with 2 links in it like this: <p><a link>Link1<span>Tooltip1</span></a></p> <p><a link>Link2</a><span>Tooltip2</span></p> The spans are hidden until hovered over, using a display:none to display:block switch. The links are positioned relative and the blocks are positioned absolute. The behavior I'm seeing is that Link2 will "bleed" through the tooltip block, obscuring the text in the block. I've tried a couple of other positioning strategies and using z-index with no improvement. Can someone have a look and see if you can help? Visit http://www.tipsweb.com/about/events/conference2007/agenda_new.asp And mouse over the Brazos 2 session links from 1:00 pm - 2:30 pm on Tuesday April 17th. Thanks! Chris Similar TutorialsI camped out this weekend and worked all day and night to build one of the more advanced forms that I need. I am really pleased with the results so far, at least in IE. It is not perfect. I am having some problems with how it looks in FireFox. It looks great in IE. However, in Firefox, you can see the sections are bleeding together. Each is in it's own DIV set as BLOCK. The sections are Core Details Features Description Contact/Shipping/Payment Promotion Brief example <div> <h2>Core</h2> content bla bla bla </div> <div> <h2>Details</h2> content bla bla bla </div> The H2 headers, the text is bleeding into the div of the section before it. In IE, it doesn't. in FF, it's all jumbled up. Here's a link to an .html file of the form. It should open up in any browser since it references CSS by url and graphics by url. Can anybody check and see if it is a quick fix? I'm not sure what the problem is. I don't have any extra cash at the moment so I'm stuck. I've been trying to figure out the problem all weekend to no avail. http://quotes.cybercon.net/classifiedsform.html Also, here are two pics. Screenshots from IE and FF. In the IE screenshot, you can see how I outlined each section. The H2 headline tag (core/details/description/feature) is bleeding into the previous section. http://quotes.cybercon.net/classifiedformIE.jpg http://quotes.cybercon.net/classifiedformFF.jpg Thanks! -Jason Hi all, the page i am talking about is... http://sydneynightowl.com.au/home.php The problem is the the div 3column seems to start too early in the work flow and also the background colour on the header bleeds. The div and header should be starting after the first 3 divs (which are set to float) I hope i have explain this correctly, any help is apriciated. The css code is Code: @charset "utf-8"; /* CSS Document */ body {background-color:#000000; background-image: url(../images/background.jpg); background-repeat:no-repeat; background-position:center top; color:#FFFFFF; font-family:"Lucida Sans Unicode", sans-serif; font-weight:100; font-size:12px;} #container { position:absolute; width: 700px; left:50%; margin-left:-358px; } #header { margin-top:0px; height: 115px;} #toolbar {height: 30px; line-height:10px; padding: 0px 10px; font-variant:small-caps; } #cornerlogo { position:fixed; top:5px; left:5px; } #topnavigation {height: 35px; line-height:35px; text-align:center;} #content { border-bottom:1px;} .3column {width:695px; padding-right:5px; padding-left:5px; margin-top:5px;} #leftcolumngl {float:left; width:223px; height:370px; padding-right:5px; padding-left:5px; padding-top:5px; margin-top:15px; margin-right:5px; border:#FFFF00 solid thin;} #middlecolumngl {float:left; height:370px; width:225px;} #rightcolumngl {float:left; height:370px; width:230px; padding-left:5px;} #leftcolumn { float:left; width:230px; padding-right:5px;} #middlecolumn {float:left; width:230px;} #rightcolumn {float:left; width:230px; padding-left:5px;} #imagecolumn {float:left; width:340px; padding-left:5px;} #infocolumn {float:left; width:340px; padding-left:5px;} #footer {height: 30px; border:thin solid #FFFFFF; clear:both; text-align:center; margin-bottom:30px; margin-top: 30px; line-height:25px;} #bgfirst { position:absolute; top:190px; left:0px; width:90%; height:200px; margin-bottom:20px; background-color:#00CC00; } #bgsecond {position:absolute; top: 400px; right:0px; width:90%; height:200px; background-color:#660066; } a:link {color: #fffc00; font-weight: normal;} a:active {color: #fffc00; font-weight: normal;} a:visited {color: #fffc00; font-weight: normal;} a:hover {color: #fffc00; font-weight: bold;} a.event:link {color: #fffc00; font-weight: normal;} a.event:active {color: #fffc00; font-weight: normal;} a.event:visited {color: #fffc00; font-weight: normal;} a.event:hover {color: #fffc00; font-weight: bold;} a.club:link {color: #fffc00; font-weight: normal;} a.club:active {color: #fffc00; font-weight: normal;} a.club:visited {color: #fffc00; font-weight: normal;} a.club:hover {color: #fffc00; font-weight: bold;} h1 { text-align:center; color:#000000; background-color:#fffc00; margin-left:3px; margin-right:3px; font-variant:small-caps; font-size:22px;} h2 {text-align:center; color:#fffc00; background-color:#333333; margin-left:3px; margin-right:3px; font-variant:small-caps; font-size:18px;} .ourprice { display:inline; color:#FF0000; line-height:20px; font-variant:small-caps; font-size:14px;} img { border-color:#fffc00; border-style:solid; border-width:thin; } img.noborder { border:none;} img.venues {float:left; margin:10px;} .mainnavimages { border-color:#979700; border-style:solid; border-width:thin; } p {line-height:15px;} strong { color:#fffc00;} Well here is my problem... I'm trying to do a fluid design with complete css. All is fine, however when I view my page I can't get the content to fill an entire area. I tried to use a width:100% but that stretches it way too much and it goes over the container div. What I want is for it to go the container div but not over, is there any way I can do this with the current layout? I would post the code but tis a lil big so would be easier to just direct you to my site. I have tried many different thing but to no avail. Any help would be greatly appreciated. TiA -BoNfiRe I have successfully implemented css tooltips on my links page to provide a short description of the site on hover... I had to apply a positive z-index change on the anchor tag when hovered in order for the span to cover the following links... but this "fix" doesn't work for IE7... any ideas? [edit]I also had to add text-decoration:none to hide the underline from IE7[/edit] Links Page The relative css css Code: Original - css Code a.spantip { position:relative; z-index:50; } a.spantip:hover { font-size:1em; z-index:55; } a.spantip span { display:none; text-decoration:none; } a.spantip:hover span { position:absolute; top:5px; left:30px; width:250px; display:block; color:#666666; font-weight:normal; background:#ffcc66; border:1px solid #ff6600; } a.spantip { I am trying to make tooltips, using PHP code inside <span>. Is there possibility to control the position in <style>, to avoid possibility for the box (tooltip), not to be completely visible, I mean, when the word that has to be described is at the right bottom of the window, box will change it's position and will be placed at the upper and left position. The box would have to be placed at the position it can have to be readable. Okay, so I needed tooltips on my site and made some. Then realised they didn't work on IE and implemented the csshover3.htc but for some reason it still doesn't work. Actually, it doesn't work on any IE I have around here, while it SHOULD work on IE7 and IE8 right? Well it just displays the "trigger" text and the tooltip text in plain text without any of the hover css code displayed below, other css code (like "body") is applied. I'm not that great with css so that could cause the problem. I did add the MIME-type text/x-component .htc If anyone could help me out here, I would really appreciate it Thanks! This is a cut from my css file (general.php): (zz is a tag I made to spawn the tooltips, could that be the problem?) Code: body { color: white; font-family: "Verdana"; font-size:12px; behavior:url("csshover3.htc"); } zz span{display: none;} zz:hover{ font-weight:bold; position: relative; } zz:hover span.tooltip{ position: absolute; font-weight:normal; padding: 5px; color: white; display: block; background: #111111; border: 1px solid orange; top: 20px; left: 20px; } This is my csshover3.htc file Code: <public:attach event="ondocumentready" onevent="CSSHover()" /> <script> // <![CDATA[ /** * Whatever:hover - V3.00.081222 * ------------------------------------------------------------ * Author - Peter Nederlof, http://www.xs4all.nl/~peterned * License - http://creativecommons.org/licenses/LGPL/2.1 * * Whatever:hover is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * Whatever:hover is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * howto: body { behavior:url("csshover3.htc"); } * ------------------------------------------------------------ */ window.CSSHover = (function(){ // regular expressions, used and explained later on. var REG_INTERACTIVE = /(^|\s)((([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active|focus))/i, REG_AFFECTED = /(.*?)\:(hover|active|focus)/i, REG_PSEUDO = /[^:]+:([a-z-]+).*/i, REG_SELECT = /(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, REG_CLASS = /\.([a-z0-9_-]*on(hover|active|focus))/i, REG_MSIE = /msie (5|6|7)/i, REG_COMPAT = /backcompat/i; // css prefix, a leading dash would be nice (spec), but IE6 doesn't like that. var CSSHOVER_PREFIX = 'csh-'; /** * Local CSSHover object * -------------------------- */ var CSSHover = { // array of CSSHoverElements, used to unload created events elements: [], // buffer used for checking on duplicate expressions callbacks: {}, // init, called once ondomcontentready via the exposed window.CSSHover function init:function() { // don't run in IE8 standards; expressions don't work in standards mode anyway, // and the stuff we're trying to fix should already work properly if(!REG_MSIE.test(navigator.userAgent) && !REG_COMPAT.test(window.document.compatMode)) return; // start parsing the existing stylesheets var sheets = window.document.styleSheets, l = sheets.length; for(var i=0; i<l; i++) { this.parseStylesheet(sheets[i]); } }, // called from init, parses individual stylesheets parseStylesheet:function(sheet) { // check sheet imports and parse those recursively if(sheet.imports) { try { var imports = sheet.imports, l = imports.length; for(var i=0; i<l; i++) { this.parseStylesheet(sheet.imports[i]); } } catch(securityException){ // trycatch for various possible errors, // todo; might need to be placed inside the for loop, since an error // on an import stops following imports from being processed. } } // interate the sheet's rules and send them to the parser try { var rules = sheet.rules, l = rules.length; for(var j=0; j<l; j++) { this.parseCSSRule(rules[j], sheet); } } catch(securityException){ // trycatch for various errors, most likely accessing the sheet's rules, // don't see how individual rules would throw errors, but you never know. } }, // magic starts here ... parseCSSRule:function(rule, sheet) { // The sheet is used to insert new rules into, this must be the same sheet the rule // came from, to ensure that relative paths keep pointing to the right location. // only parse a rule if it contains an interactive pseudo. var select = rule.selectorText; if(REG_INTERACTIVE.test(select)) { var style = rule.style.cssText, // affected elements are found by truncating the selector after the interactive pseudo, // eg: "div li:hover" >> "div li" affected = REG_AFFECTED.exec(select)[1], // that pseudo is needed for a classname, and defines the type of interaction (focus, hover, active) // eg: "li:hover" >> "onhover" pseudo = select.replace(REG_PSEUDO, 'on$1'), // the new selector is going to use that classname in a new css rule, // since IE6 doesn't support multiple classnames, this is merged into one classname // eg: "li:hover" >> "li.onhover", "li.folder:hover" >> "li.folderonhover" newSelect = select.replace(REG_SELECT, '.$2' + pseudo), // the classname is needed for the events that are going to be set on affected nodes // eg: "li.folder:hover" >> "folderonhover" className = REG_CLASS.exec(newSelect)[1]; // no need to set the same callback more than once when the same selector uses the same classname var hash = affected + className; if(!this.callbacks[hash]) { // affected elements are given an expression under a fake css property, the classname is used // because a unique name (eg "behavior:") would be overruled (in IE6, not 7) by a following rule // selecting the same element. The expression does a callback to CSSHover.patch, rerouted via the // exposed window.CSSHover function. // because the expression is added to the stylesheet, and styles are always applied to html that is // dynamically added to the dom, the expression will also trigger for those new elements (provided // they are selected by the affected selector). sheet.addRule(affected, CSSHOVER_PREFIX + className + ':expression(CSSHover(this, "'+pseudo+'", "'+className+'"))'); // hash it, so an identical selector/class combo does not duplicate the expression this.callbacks[hash] = true; } // duplicate expressions need not be set, but the style could differ sheet.addRule(newSelect, style); } }, // called via the expression, patches individual nodes patch:function(node, type, className) { // the patch's type is returned to the expression. That way the expression property // can be found and removed, to stop it from calling patch over and over. // The if will fail the first time, since the expression has not yet received a value. var property = CSSHOVER_PREFIX + className; if(node.style[property]) { node.style[property] = null; } // just to make sure, also keep track of patched classnames locally on the node if(!node.csshover) node.csshover = []; // and check for it to prevent duplicate events with the same classname from being set if(!node.csshover[className]) { node.csshover[className] = true; // create an instance for the given type and class var element = new CSSHoverElement(node, type, className); // and store that instance for unloading later on this.elements.push(element); } // returns a dummy value to the expression return type; }, // unload stuff onbeforeunload unload:function() { try { // remove events var l = this.elements.length; for(var i=0; i<l; i++) { this.elements[i].unload(); } // and set properties to null this.elements = []; this.callbacks = {}; } catch (e) { } } }; // add the unload to the onbeforeunload event window.attachEvent('onbeforeunload', function(){ CSSHover.unload(); }); /** * CSSHoverElement * -------------------------- */ // the event types associated with the interactive pseudos var CSSEvents = { onhover: { activator: 'onmouseenter', deactivator: 'onmouseleave' }, onactive: { activator: 'onmousedown', deactivator: 'onmouseup' }, onfocus: { activator: 'onfocus', deactivator: 'onblur' } }; // CSSHoverElement constructor, called via CSSHover.patch function CSSHoverElement(node, type, className) { // the CSSHoverElement patches individual nodes by manually applying the events that should // have fired by the css pseudoclasses, eg mouseenter and mouseleave for :hover. this.node = node; this.type = type; var replacer = new RegExp('(^|\\s)'+className+'(\\s|$)', 'g'); // store event handlers for removal onunload this.activator = function(){ node.className += ' ' + className; }; this.deactivator = function(){ node.className = node.className.replace(replacer, ' '); }; // add the events node.attachEvent(CSSEvents[type].activator, this.activator); node.attachEvent(CSSEvents[type].deactivator, this.deactivator); } CSSHoverElement.prototype = { // onbeforeunload, called via CSSHover.unload unload:function() { // remove events this.node.detachEvent(CSSEvents[this.type].activator, this.activator); this.node.detachEvent(CSSEvents[this.type].deactivator, this.deactivator); // and set properties to null this.activator = null; this.deactivator = null; this.node = null; this.type = null; } }; /** * Public hook * -------------------------- */ return function(node, type, className) { if(node) { // called via the css expression; patches individual nodes return CSSHover.patch(node, type, className); } else { // called ondomcontentready via the public:attach node CSSHover.init(); } }; })(); // ]]> </script> Hi folks I am using the excellent Adx CSS drop-down menu, which is great. One thing I'd like to add to it though, is mouseover tooltips giving more info on each link, using the span method suggested by Meyerweb and others: div#menu a:hover span { etc.... This works beautifully in FF and IE5. But IE6, bless its heart, will not display any span words in a submenu: http://ied.gospelcom.net/adxmenu.html If I substitute li:hover span in the code, then it does display every set of span words in the whole submenu. I've tried various tricks, including stuff in the IE only extra style sheet that AdX uses, but with no success. Any ideas of stuff to try? Many thanks Tony Simple question, but i'm trying to create a decent sized space in between my links, and make them white. I can make my links white, but can't seem to change the space inbetween them. HTML Code: div id="bar-links"> <center> <div class="content box1"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4"><img src="images/barlist_01.gif" width="500" height="23" alt=""></td> </tr> <tr> <td background="images/barlist_02.gif" width="20"></td> <td background="images/barlist_03.gif" width="456"> </p> <div id="bar-links"> <h4><a href="#" title="Riley's Pub">Riley's Pub</a> <a href="#" title="Ho Down Bar"style="color: #fff">Ho Down Bar</a> <a href="#" title="Depot Square"style="color: #fff">Depot Square Bar</a> <a href="#" title="Egans Pub"style="color: #fff">Egans Pub</a> </h4> </div> </td> <td background="images/barlist_04.gif" width="24"></td> </tr> <tr> <td colspan="4"><img src="images/barlist_05.gif" width="500" height="27" alt=""></td> </tr> </table> </div> CSS Code: #bar-links { text-indent:inherit; text-align:left; } Hi, If I have the following CSS: body { margin: 0px; padding: 0px; } a:link, a:visited { color: #F36706; text-decoration: none; } a:hover, a:active { color: #F36706; text-decoration: underline overline; } #siteDimention { width: 758px; margin-left: auto; margin-right: auto; padding: 0px; } How come the links in my page aren't changing from the normal blue/purple ones? Hi, I have CSS document like so: Code: div.menu A:link { definitions } div.menu A:visited { definitions } div.menu A:active { definitions } div.menu A:hover { definitions } And in my HTML document Code: <div class="menu"> Links are then put in here </div> But only the first Link effect works, how come? I tried Google, got few results I were looking for, I know that the Link effects has to be in certain order, and in these websites I found they were in different order tried both but no luck Thanks alot! I want to have a hover effect on the links of my page. I'm using an attached stylesheet to define it. Here is the section defining the links: Code: a:link { color: red; text-decoration: none; } a:hover { color: blue; text-decoration: underline; } a:visited { color: red; text-decoration: none; } a:active { color: red; text-decoration: underline; } Normal links appear red and is not underlined. When the cursor hovers over a normal link, it appears blue and is underlined. However, visited links do not 'behave' as normal links. They appear red and are not underlined. When hovered over, they do not change color or get underlined. I want visited links to act the same. They only way I could get them to act the same was to do the following: Code: a.general:link { color: red; text-decoration: none; } a.general:visited { color: red; } a.general:hover { color: blue; text-decoration: underline; } a.general:active { color: red; text-decoration: underline; } This is the only rules IE will obey. But every link need to be defined as instances of class "general". Is there a better way of handling this? I was messing around with <ul><li> type nav links, and had some issues with the bullet images I made were too large, so I made it as a background image for the <li> but <li> backgrounds didn't seem to work so well on IE. My question is this, why does everyone use <ul><li> to make their nav links when you can use less code just using <a>'s within a <div>? Here's my code example (bullet.jpg not included, it's just a 30px square I made in photoshop) Code: <html> <head> <style type="text/css"> #links li { text-indent:40px; list-style-type:none; } #links a { display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links a:hover { background:#FFF url('bullet.jpg') no-repeat; } #links2 a { text-indent:40px; display:block; line-height:30px; height:30px; width:150px; background:#EEE url('bullet.jpg') no-repeat; } #links2 a:hover { background:#FFF url('bullet.jpg') no-repeat; } </style> </head> <body> <div id="links"> <ul> <li><a href="#">links</a></li> <li><a href="#">link 2</a></li> <li><a href="#">three</a></li> </ul> </div> <div id="links2"> <a href="#">links</a> <a href="#">link 2</a> <a href="#">three</a> </div> </div> </body> </html> I have what seemed to be a simple idea but is turning out to bother me. In my style sheet i want to put a base url followed by a user id Link looks like this Code: http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id= Now in my html i have this Code: <table><tr><td >My name<td >Job position<td >606959150</tr> The last td that has the number in it i want to add to the end of the url posted above i cannot figure our what to put in the css to use as the main link and i want to add another td behind the last one with the number in it with the entirelink which should look like this Code: <a target="_blank" href="http://mywebsite.com/this_folder/remote/html_server.php?xw_controller=hitlist&xw_action=set&target_id=606959150">Link</a> I have to use this for multiple people each one using a unique ID# is there a simple way to do this, the reasoning behind this is that the main link changes once every few months, instead of changing all links i would like to be able to just change the one in the css file and be done with it. i hope i am explaining it correctly. Thanks ahead of time for any help u can provide I have set up a CSS file for a website I am building, however, when I click on the links which work correctly (at first) it goes to the desired place, if I go "back" the link turns to a larger italic font. Look here for example. http://www.burrellprolabs.com/newsite.htm if you click on one of the body copy links under "latestNEWS" then go back you will see what I mean. here is my css style for that particular part: .bodycopy { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #575757; text-decoration: none; line-height: 13px; } .bodycopy a:link { color: #BF0000; text-decoration: none; } .bodycopy a:active { color: #BF0000; text-decoration: none; } .bodycopy a:visited { color: #BF0000; text-decoration: none; } .bodycopy a:hover { color: #969696; text-decoration: underline; I'm currently working on a website for college, but I've run into an issue I can't work out. I can't seem to get rid of the default purple box that appears around my links. The HTML: Code: <div id="homelink"><a href="index.html"></a></div> The CSS: Code: #homelink{ position:absolute; width:53px; height:17px; margin-top:25px; margin-left:70px; z-index:10; } #homelink a{ display:block; background-image:url(images/links/home.png); background-repeat:no-repeat; width:53px; height:17px; } #homelink a:hover{ display:block; background-image:url(images/links/homehover.png); width:53px; height:17px; } As you can see, I use a background image for the div and no text for the link. Clicking the background image works fine and takes me to the homepage, however I get the default visited and active link border around it. Is there any way to solve this so that no border appears? question is about CSS and links. I can get underline effect, background change, etc by using .a but i need to have more than one sort of link in my page, e.g. menu links cannot have the same effect as links in the main text. How do i set up more than two link effects? I am not sure if these links count as navigation or not, so not sure if I should be using the UL element for semantic correctness? <div id="footer_bottom" class="bold"> <a href="sitemap.php" title="Sitemap">Sitemap</a> | <a href="accessibility.php" title="Accessibility Options">Accessibility Options</a> | <a href="http://validator.w3.org/check?uri=referer;verbose=1" rel="external" title="Validate XHTML">XHTML Valid</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="external" title="Validate CSS formatting">CSS Valid</a> </div> My first post Website:www.freewebs.com/weareamazing I can't figure out how to move the links that are at the top of my page (Home, Graphics, Icons, Linking Back, Credits) to the side of my table. I also want to get rid of that line that is under the links. Thank you for your help! Hi, How would I code a div that is also a link? I want to have boxes on my page that will be links to other pages. I want to be able to have the div change background colour when you hover over the entire div. I've tried: .selectionBar { padding: 5px; background: #6687B5; width: 150px; } .selectionBar a { color: #FFFFFF; } .selectionBar a:hover { background: #516C91; } <div class="selectionBar"><a href="">Text Field</a></div> But that just changes the background colour directly around the text inside the href, and doesn't make the entire div a link. |