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 5 of 5
  1. #1
    c12
    c12 is offline
    New Coder
    Join Date
    Jan 2013
    Posts
    20
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Cool CSS tool tip doesn't work in browser

    For some reason this tool tip is not working when I test it in the browser or when I put it on the server. I've used this exact script for tool tips in the same browser and the same server. There is just a little pop up without the text.

    Code:
    .tooltip6{
        display: inline;
        position: absolute;
        margin-top: -10px;
    }
    .tooltip6:hover:after{
        background: #333;
        background: rgba(0,0,0,1);
        border-radius: 5px;
        bottom: 25px;
        color: #fff;
        content: attr(title); 
        left: -12%;
        padding: 5px 15px;
        position: absolute;
        z-index: 98;
        width: 220px;
        content: "The information that is gathered will help developers understand the users tendencies involved with this website, and
    			use the structure to optimize the site-user interface";
    	font: bold;
    }
    
    .tooltip6:hover:before{
        border: solid;
        border-color: #333 transparent;
        border-width: 6px 6px 0 6px;
        bottom: 20px;
        content: "";
        left: 50%;
        position: absolute;
        z-index: 99;
    }
    When I look at it in firebug it seems like it just doesn't read the css. Because when I add " content: "text whatever"; " in the css it works.

    Any Ideas would be greatly appreciated
    Thanks!

  • #2
    Regular Coder Nerevarine's Avatar
    Join Date
    Jan 2013
    Location
    Phendrana Drifts
    Posts
    283
    Thanks
    0
    Thanked 17 Times in 17 Posts
    Blog Entries
    3
    Shouldn't you be using
    Code:
    <meta content="Yourtexthere">
    in your HTML instead of a CSS property for this?
    Time kills us in our sleep and we watch it happen in our dreams. -K.K.
    THE END-ALL PROGRAMMING REFERENCE: CLICK HERE (Courtesy of Major Payne)
    My username was previously L0adOpt1c. :: Please read this before posting in the HTML/CSS forum.
    Validate your HTML here and your CSS here. :: Need basic HTML/CSS tutorials? Click here, don't post about it.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello c12,
    I think you are using the CSS content property wrong. I'd like to see one of your working tooltips using this same code.

    It would also help to see the markup that goes along with the problem CSS you've posted.

    Look at the usual approach - http://jackosborne.com/articles/css-...seudo-element/
    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

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    content in the css is such a bad idea. I wish they had never added that.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by DanInMa View Post
    content in the css is such a bad idea. I wish they had never added that.
    I totally agree Dan!! CSS is not for presentation.
    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


  •  

    Tags for this Thread

    Posting Permissions

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