Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,097
    Thanks
    297
    Thanked 12 Times in 12 Posts

    Exclamation little css trouble

    I have a tooltip set up with just css and its working fine if the code is not wrapped in <li> tags

    my css is
    Code:
    <style type="text/css">
    a.tt{
        position:relative;
        z-index:24;
        color:#3CA3FF;
    	font-weight:bold;
        text-decoration:none;
    }
    a.tt span{ display: none; }
    
    /*background:; ie hack, something must be changed in a for ie to execute it*/
    a.tt:hover{ z-index:25; color: #aaaaff; background:;}
    a.tt:hover span.tooltip{
        display:block;
        position:absolute;
        top:0px; left:0;
    	padding: 15px 0 0 0;
    	width:200px;
    	color: #993300;
        text-align: center;
    }
    a.tt:hover span.top{
    	display: block;
    	padding: 30px 8px 0;
        background: url(bubble.gif) no-repeat top;
    }
    a.tt:hover span.middle{ /* different middle bg for stretch */
    	display: block;
    	padding: 0 8px; 
    	background: url(bubble_filler.gif) repeat bottom; 
    }
    a.tt:hover span.bottom{
    	display: block;
    	padding:3px 8px 10px;
    	color: #548912;
        background: url(bubble.gif) no-repeat bottom;
    }
    </style>
    and if my code is like so
    PHP Code:
                    <a href="#" class="tt">
                        <?php echo $serv->name?>
                        <span class="tooltip">
                            <span class="top"></span>
                            <span class="middle"><?php echo $serv->description?></span>
                            <span class="bottom"></span>
                        </span>
                    </a>
                    <span class="price">£<?php echo $serv->price?></span>
                    <span class="filler">&nbsp;</span>
    but not if the above code is wrapped in <li> tags like so
    PHP Code:
                    <li><a href="#" class="tt">
                        <?php echo $serv->name?>
                        <span class="tooltip">
                            <span class="top"></span>
                            <span class="middle"><?php echo $serv->description?></span>
                            <span class="bottom"></span>
                        </span>
                    </a>
                    <span class="price">£<?php echo $serv->price?></span>
                    <span class="filler">&nbsp;</span></li>
    what do i need to change in my css code to get it working properly

    many thanks

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello LJackson,
    I can't seem to duplicate your issue with the code you've provided. The tooltip works (in FF) both wrapped in <li> tags or not.

    Do you have a demo site up?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,097
    Thanks
    297
    Thanked 12 Times in 12 Posts
    got it working now mate, thanks for offering to help

    not sure what was causing it not to work in the first place :O


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •