ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Hover inside Rectangle

    Scheduled Pinned Locked Moved IT Discussion
    11 Posts 3 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LakshmanaL
      Lakshmana
      last edited by

      Can anyone help me in hovering the text inside the rectangle.There are three rectangles ,two are in same line third rectangle is within the edge of first and second.There are some text present inside the boxes.There are three classes used inside div and three classes are called in CSS as external sheet.
      But the hover is not happening?
      Before asking this doubt i have referred w3schools also no luck

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        Can you show us the code that you are using currently?

        LakshmanaL 2 Replies Last reply Reply Quote 0
        • LakshmanaL
          Lakshmana @scottalanmiller
          last edited by scottalanmiller

          @scottalanmiller

          <!doctype html>
          <HTML>
          <html lang="en-us" >
          <head>
          <link rel="stylesheet" type="text/css" href="task3.css">
          <link href="https://fonts.googleapis.com/css?family=Great+Vibes" rel="stylesheet">
          <title>Home | Tooltip </title>
          </head>
          <body background="siva.jpg">
          <div class="rec rectangle1">1 
          <span class="tooltip1">I am a tooltip!</span></div>
          
          <div class="rec rectangle2">2<br/>
          <div class="tooltip2">I am a tooltip!</div></div>
          
          
          <div class="rec rectangle3">3<br/>
          <div class="tooltip3">I am a tooltip!</div></div>
          
          </body>
          </html>
          
          1 Reply Last reply Reply Quote 0
          • LakshmanaL
            Lakshmana @scottalanmiller
            last edited by scottalanmiller

            @scottalanmiller

            .rec{ 
            position: absolute;
            top:30px;
            width: 320px;
             padding: 100px;
             border: 5px solid gray;
             margin: 0;
            text-align:left;
            color: black;
            font-size:40px;
            border-color: yellow;
            
            }
            title, .rec {
              font-family: "Great Vibes";
            }
            
            .rectangle2{position:absolute;
            left: 662px;
            background-color:white;}
            
            .rectangle3{position:relative;
             left: 340px;
             top: 270px;
            background-color:green;}
            
            .rectangle1 {
                position: relative;
                left:30px;
                background-color: red;
                display: inline-block;
                border-bottom: 1px dotted black;
            }
            
            .rectangle1.tooltip1 {
                visibility: hidden;
                width: 120px;
                background-color: #555;
                color: #fff;
                text-align: center;
                border-radius: 6px;
                padding: 5px 0;
                position: absolute;
                z-index: 1;
                bottom: 125%;
                left: 50%;
                margin-left: -60px;
                opacity: 0;
                transition: opacity 1s;
            }
            
            .rec1 .tooltip1::after {
                content: "";
                position: absolute;
                top: 100%;
                left: 50%;
                margin-left: -5px;
                border-width: 5px;
                border-style: solid;
                border-color: #555 transparent transparent transparent;
            }
            
            .rec1:hover .tooltip1 {
                visibility: visible;
                opacity: 1;
            }
            
            LakshmanaL thwrT 2 Replies Last reply Reply Quote 0
            • LakshmanaL
              Lakshmana @Lakshmana
              last edited by

              @Lakshmana
              The code is incomplete only

              1 Reply Last reply Reply Quote 0
              • thwrT
                thwr @Lakshmana
                last edited by thwr

                Didn't inspect your code, but you got a double colon in your CSS at

                .rec1 .tooltip1::after {
                

                This might cause issues

                LakshmanaL 1 Reply Last reply Reply Quote 0
                • LakshmanaL
                  Lakshmana @thwr
                  last edited by

                  @thwr i have opened a pseudo class for hovering Whether it will create a problem?

                  scottalanmillerS 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @Lakshmana
                    last edited by

                    @Lakshmana said in Hover inside Rectangle:

                    @thwr i have opened a pseudo class for hovering Whether it will create a problem?

                    Did you fix the thing that he mentioned before going on to do anything else?

                    LakshmanaL 1 Reply Last reply Reply Quote 1
                    • LakshmanaL
                      Lakshmana @scottalanmiller
                      last edited by

                      @scottalanmiller Done some changes in html and css.but the hover comes in unknown format.I have given the code in html as well as CSS.Verify this.I want the hover to be there inside rectangle 1 and it show as It is a tooltip but it is not happening

                      <!doctype html>
                      <HTML>
                      <html lang="en-us" >
                      <head>
                      <link rel="stylesheet" type="text/css" href="task3continue.css">
                      <link href="https://fonts.googleapis.com/css?family=Great+Vibes" rel="stylesheet">
                      <title>Home | Tooltip </title>
                      </head>
                      <body background="siva.jpg">

                      <span class="tooltip1">Hover me</span>
                      <div class="rec rectangle1">Number<br/>

                      </div>

                      <div class="rec rectangle2">2<br/>
                      <div class="tooltip2">I am a tooltip!</div></div>

                      <div class="rec rectangle3">3<br/>
                      <div class="tooltip3">I am a tooltip!</div></div>

                      </body>
                      </html>

                      .rec{
                      border-color:yellow;
                      height: 150px;
                      width: 400px;
                      color:black;
                      font-size: 30px;

                      }
                      title, .rec {
                      font-family: "Great Vibes";
                      }

                      .rectangle1{background-color: brown;
                      position:fixed;
                      top:40px;
                      left:40px;
                      }

                      .rectangle2{background-color: red;
                      position:relative;
                      left:500px;
                      top:40px;}

                      .rectangle3{background-color: violet;
                      position:relative;
                      left: 280px;
                      top: 4px;

                      }

                      .rectangle1{
                      background-color: yellow;
                      padding: 20px;
                      display: none;
                      }

                      span:hover + .rectangle1{
                      display: block;
                      }

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        I don't see any CSS for the tooltip1 span.

                        LakshmanaL 1 Reply Last reply Reply Quote 0
                        • LakshmanaL
                          Lakshmana @scottalanmiller
                          last edited by

                          @scottalanmiller without that css file the tooltip is running

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post