• TechQA.

        Issue with HTML/CSS tab when it hover or active

        393 views Asked by Vaishakh P At 2015-06-11T15:40:28+00:00 11 June 2015 at 15:40 2025-12-12T11:16:15+00:00

        I am facing an issue with a tab. You can see the link here below:

        <div class="dm-main-tab-menu">
            <ul>
                <li class="Content active"><a accesskey="1" href="?content">Content</a></li>
        
                <li class="Objects"><a accesskey="1" href="?library">Libraries</a></li>
        
                <li class="Forms"><a accesskey="1" href="?applications">e-Forms</a></li>
        
                <li class="Reports"><a accesskey="1" href="?statistics">Statistics</a></li>
        
                <li class="Settings"><a accesskey="1" href="?settings">Settings</a></li>    
            </ul>
        </div>
        

        jsFiddle

        As you can see the Second tab which is "Libraries" when hovering it, the icon is not visible and also the same issue for active.

        Can someone please help me to fix this issue?

        html css tabs hover
        Original Q&A
        2

        There are 2 answers

        0
        AGE AGE On 2015-06-11T15:53:12+00:00 11 June 2015 at 15:53

        Replace this:

        .dm-main-tab-menu > ul > li.Objects > a:hover {
            color: #ffffff;
            background:url(gNew/Main/library_hover.gif) no-repeat 22px 12px !important;
        }
        

        For this:

        .dm-main-tab-menu > ul > li.Objects > a:hover {
            color: #ffffff;
            background:url(https://cdn3.iconfinder.com/data/icons/glypho-free/64/cog-settings-alt-16.png) no-repeat 22px 12px !important;
        }
        

        You are effectively setting the background of your Objects element to something else, which is not the effect you desire (according to your question). Instead leave it as is and let :active do something else for you if you desire, from there on is up to your personal implementation.

        0
        AmJustSam AmJustSam On 2015-06-11T17:12:41+00:00 11 June 2015 at 17:12

        This is how your code looks like.

        /* Library Starts */
        
        .dm-main-tab-menu > ul > li.Objects {
        
        color: #ffffff;
        
        background:url(https://cdn3.iconfinder.com/data/icons/glypho-free/64/cog-settings-alt-16.png)  22px 0px no-repeat !important; // Link working fine
        
        padding:0px 0px 9px 0px;
        
        margin:11px 0px 0px 3px;
        
        }
        
        .dm-main-tab-menu > ul > li.Objects > a:hover {
        
        color: #ffffff;
        
        background:url(gNew/Main/library_hover.gif) no-repeat 22px 12px !important; // Directory doesn't working
        
        }
        
        .dm-main-tab-menu > ul > li.Objects > .active {
        
        color: #ffffff;
        
        background:url(gNew/Main/library_hover.gif) no-repeat 22px 12px !important; // Directory doesn't working
        }
        

        This is how it looks after being fixed.

        /* Library Starts */
        
        .dm-main-tab-menu > ul > li.Objects {
        
        color: #ffffff;
        
        background:url(https://cdn3.iconfinder.com/data/icons/glypho-free/64/cog-settings-alt-16.png)  22px 0px no-repeat !important;
        
        padding:0px 0px 9px 0px;
        
        margin:11px 0px 0px 3px;
        
        }
        
        .dm-main-tab-menu > ul > li.Objects > a:hover {
        
        color: #ffffff;
        
        background:url(https://cdn3.iconfinder.com/data/icons/glypho-free/64/cog-settings-alt-16.png) no-repeat 22px 12px !important; // Replaced directory with link.
        
        }
        
        .dm-main-tab-menu > ul > li.Objects > .active {
        
        color: #ffffff;
        
        background:url(https://cdn3.iconfinder.com/data/icons/glypho-free/64/cog-settings-alt-16.png) no-repeat 22px 12px !important; // Replaced directory with link.
        }
        

        It think basically the problem is with directory, It doesn't getting the directory that your giving in "hover and active' css code. So I replced that directory with link and it works fine.


        Also you can't use.

        <li class="Content active"></li> - will not work.
        

        A class should be without spaces, So you can use hyphens like this.

        <li class="Content-active"></li> - It will work.
        

        Related Questions in HTML

        • How to store a date/time in sqlite (or something similar to a date)
        • How to use custom font during html to pdf conversion?
        • Storing the preferred font-size in localStorage
        • mp4 embedded videos within github pages website not loading
        • Scrimba tutorial was working, suddenly stopped even trying the default
        • Is there any way to glow this bulb image like a real light bulb
        • With non-graphical maps in Leaflet, zoomDelta doesn't work
        • What can I do to improve my coding on both html and css
        • Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
        • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
        • Displaying a Movie List on a Website Using Jinja2 and Bootstrap
        • How to redirect to thank you page after submitting a Google form embedded into a Google Site?
        • Storing selected language in localStorage
        • Fences (parenthesis, braces) in HTML and MathML
        • Understanding Scroll Anchoring Behavoir

        Related Questions in CSS

        • How to use custom font during html to pdf conversion?
        • Storing the preferred font-size in localStorage
        • mp4 embedded videos within github pages website not loading
        • Is there any way to glow this bulb image like a real light bulb
        • What can I do to improve my coding on both html and css
        • Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
        • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
        • How to increase quality of mathjax output?
        • Hover animation resetting( seemingly reverting back to original CSS and then again to hover)when moving mouse horizontaly accross a part of an element
        • Storing selected language in localStorage
        • How to clip grid cell and provide scroll as well?
        • KeyboardAvoidingView makes a messy the flexbox
        • Rotate an object around another object in javascript
        • Understanding Scroll Anchoring Behavoir
        • how to use only block layout in this css code?

        Related Questions in TABS

        • Visual Studio 2022 convert spaces to tabs on checkout and back to spaces on checkin
        • How to get new text input after entering a password in a tab?
        • I need assistance with scripting between tabs for Google Sheets
        • Removing tabPanel(s) with same title in shiny
        • I want change the color of TabRow to black using indicatorColor = Color.Black, but in material3 indicatorColor not exist anymore
        • Change background on Tab react native app
        • User non Administer System on Apache Guacamole can access history tab?
        • Chrome Extension: Uncaught SyntaxError: Unexpected reserved word
        • Switching between tabs Ant Design Vue
        • Automatically log the user out when the browser or tab closes
        • create new workbook from excel tab and save to new location and close it and then grab the next tab and save to a different location using VBA
        • Make the Reviews Tab Active on Elementor Product Data Tabs
        • Blazor Web App: How to correctly open razor pages from referenced projects in new tabs?
        • Visual Studio 2022 Community: Tab Spacing Off (Extra Indent?)
        • How to create a pivot table that pulls data from multiple tabs?

        Related Questions in HOVER

        • Hover animation resetting( seemingly reverting back to original CSS and then again to hover)when moving mouse horizontaly accross a part of an element
        • Custom hover documentation for Latex command in VS code with Latex Workshop extension
        • Replacing Text using Javascript
        • How to set text inside a div using JavaScript and CSS
        • Making a fade in when in sight thing but it messed up my :hover effect for a card thing
        • Override JS by hovering out of a div?
        • How to change the color of an icon when hovered over
        • How to change the hover information in dygraphs R?
        • CSS Hovering to adjust text opacity doesnt work as intented, simplified as much as possible
        • How to stop this text rotator on hover?
        • i've styled my hr tag but it doesn't work, what should i do?
        • Tailwind Button - gradient hover dark mode not working?
        • Hover on image makes 2 elements appear
        • Can hoverEffect in visionOS have a custom color?
        • Triangles (CSS) that Grow with the Inside Text?

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)
        • Privacy
        • Terms
        • Cookies
        • Homegardensmart
        • Math
        • Aftereffectstemplates