The Z Index will not be effective because the position is already set to relative or absolute

I'm having an issue with a tooltip on my website. Despite adding the necessary CSS positions, the tooltip does not display correctly.

The problem arises when the tooltips from the icons on the left don't show up properly on top of the content to the right.

The code snippet that seems to be causing the problem is as follows;

a.icon {
    position: relative;
    text-decoration: none;
}

a.icon .tooltip {
    -webkit-transition: opacity 0.5s ease 0.2s, left 0.5s ease 0.2s;
    -moz-transition: opacity 0.5 ease 0.2s, left 0.5s ease 0.2s;
    -o-transition: opacity 0.5 ease 0.2s, left 0.5s ease 0.2s;
    transition: opacity 0.5 ease 0.2s, left 0.5s ease 0.2s;
    opacity: 0;
    font-size: 11px;
    color: #FFFFFF;
    background:url('../images/tooltip.png') no-repeat bottom center;
    position:absolute;
    height: 40px;
    line-height: 50px;
    left: 100px;
    text-align:center;
    padding-left:10px;
    width: 110px;
    display: block;
    top: 24px;
    z-index: 1000;
}

a.icon:hover .tooltip {
    opacity: 1.0;
    top:24px;
    
}

And here is the HTML structure without lorem ipsum text;

<div id="icons">
<a href="info page" class="icon" id="info"><span class="tooltip">About Me</span></a>
<a href="portfolio page" class="icon" id="portfolio"><span class="tooltip">Portfolio</span></a>
<a href="mailto:" class="icon" id="email"><span class="tooltip">Mail</span></a>
<a href="?userinfo" class="icon" id="skype"><span class="tooltip">Skype</span></a>
<a href="" class="icon" id="twitter"><span class="tooltip">Twitter</span></a><!-- Holds the icons for the site -->
</div>
<div id="content">
raesent at quam velit,
</div>

Although there are span classes associated with tooltips, they cannot be added as code within this text box.

In conclusion, the tooltip functionality is not displaying as intended. You can view an example live on [website link].

Apologies if the code appears disorganized; I am new to web development and still in the process of setting up my portfolio.

Thank you for your help.

Answer №1

.......................................

Greetings, now let's establish the #content position and z-index

as shown below

#content{
position:relative;
z-index:-1;
}

Alternatively for a 2nd choice

#icons{
position: relative;
    z-index: 2;
}

To adjust opacity

Add this css code

#info:hover, #portfolio:hover, #email:hover, #skype:hover, #twitter:hover{
opacity:1;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing Node and Electron to dynamically adjust CSS style properties

Having a dilemma here: I need to access the CSS properties from styles.css within Electron. Trying to use document.getElementsByClassName() won't work because Node doesn't have document. The goal is to change the color of a specific div when the ...

What is the best method for selecting an Iframe in Firefox using HTML?

As a student working on building a website, I recently added some iframes to a WordPress page and noticed that all links were opening in new tabs specifically in Firefox. The HTML code in question: <a href="http://example" target="exampl ...

The dimensions of the glyph icon placed inside a tab

http://jsfiddle.net/r9dunwzs/1/ <ul id="myTab" class="nav nav-tabs"> <li class="active"><a href="#home" data-toggle="tab">one</a></li> <li> <a href="#profile" data-toggle="tab"> ...

What is the process for uploading an image using Vue.js?

Looking for guidance on how to upload an image using Vue.js. This is my HTML code to insert a picture: <input type="file" id="wizard-picture"> And here is my Vue.js code: <script> submitBox = new Vue({ el: "#submitBox", data: { usernam ...

Challenges with adjusting the value of HTML range inputs

Within my HTML, I have incorporated the following three elements: <button id="left" >Previous</button> <input id="animSlider" type="range" min="0" max="0" step="1" value="0" /> //THE MAX VALUE IS SET DYNAMICALLY UPON PAGE LOAD, NOT AS ZE ...

Make the child div images disappear gradually and at the same time, make an overlapping parent div image appear using Javascript

Check out my attempt at solving this challenge on jsfiddle: http://jsfiddle.net/oca3L32h/ In the scenario, there are 3 divs within a main div. Each of these divs contains an image and they overlap each other. By using radio buttons, the visibility of the ...

Blending an HTML jQuery toggle

Is there a way to make the current headline fade out while simultaneously fading in a new one when switching to the next div using a jQuery .html switch? Check out the codepen example: https://codepen.io/balke/pen/JpNNve $(window).scroll(function() { ...

The input tag loses focus after its value is updated using a class method in Angular 8.x

Currently, I am working on integrating a credit card payment method and formatting its number through specific methods. Here is how it is done: HTML <div class="form-group" *ngFor="let formField of cardFields; let cardFieldIndex = index;"> ...

In the process of transforming my JavaScript code into JQuery

I'm struggling to convert my JavaScript code into jQuery, especially when it comes to calling the function for radio elements by name. The original JavaScript works fine, but I can't seem to get the jQuery version to work correctly. Index HTML ...

Utilizing two distinct CSS frameworks within a single Rails application

At the moment, I have an application with its frontend built using Bootstrap 3 (leveraging the bootstrap-rails gem). Now, I am looking to incorporate the Materialize.css framework into the same app. After downloading the Materialize.css stylesheet, my conc ...

When I add a duration in a jQuery toggle function, the Bootstrap 3 tooltip ceases to function properly

After searching extensively, I have yet to find a solution. I am uncertain where the problem lies - whether it's an issue with Bootstrap or something else entirely. What I've done is created a fixed horizontal navbar at the top of my website with ...

Adding CSS classes through the .addClass method - A guide on utilizing linked CSS files

I came across this code snippet and I have a quick question. $(window).scroll(function() { var y_scroll_pos = window.pageYOffset; var scroll_pos_test = 150; // adjust as needed if(y_scroll_pos > scroll_pos_test) { $( "#cssmenu" ).addCl ...

Tips for keeping a Bootstrap Modal in a fixed position on the screen as you scroll

I am facing an issue with a button that is supposed to trigger a Bootstrap Modal. It seems that the modal is not visible when the page has been scrolled down. Upon clicking the button to show the modal, the background darkens as expected, but the modal its ...

Using Javascript to convert numerical input in a text box into its corresponding letter grade

I have been working on this code, but I am facing some issues with displaying the result. My goal is to input a number, such as "75", click a button, and have the bottom textbox show the corresponding letter grade, starting with "C" for 70-80 range. Here i ...

What is the best method for adjusting the size of a button on a video as needed?

@import url("https://fonts.googleapis.com/css2?family=Luxurious+Script&display=swap"); * { margin: 0px; padding: 0px; box-sizing: border-box; font-family: "Luxurious Script", cursive; } body { background-color: #e97272; } .navbar { backgr ...

PHP does not provide any error when an update on a database row fails

When I try to update values retrieved from the database into a form on submission, the process fails without any error message. Below is the PHP code snippet: <?php session_start(); $username=$_SESSION['uname']; $cn=mysqli_connect("loc ...

Steps for accessing registration form data once the signup button has been clicked

Hello everyone! I have a code that includes login and registration forms as tabs. When we click on either one, it goes to the respective form. Now, I want to make a change by removing the Register tab and adding it as a signup button next to the login butt ...

The left-floated image extends beyond the boundaries of the div

I have a situation where text and an image are combined but the cat image goes outside of the parent div. Is there a solution to this issue? View the code here <div style="border:1px solid #CCCCCC"> <img style="float: left;" src="http://plac ...

The error message "Cannot read property 'option0' of undefined" occurs when using Node.js with Express and EJS

script.js var choices = { choice0: 11, choice1: 'choice1', choice2: 'choice2', choice3: 'choice3', choice4: 'choice4', choice5: 'choice5', choice6: 'choice6', choice7: 'choice7', choice ...

Bootstrap 3: the collapse button disappears on smaller screens

I am working on creating a responsive navbar using Bootstrap's collapse feature for small screens. Take a look at the code for my navbar: %nav{:class => "navbar navbar-default", :id => "nav_inicio", :role =>"navigation"} .container-fluid ...