• DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        Issue with HTML/CSS tab when it hover or active

        387 Views Asked by Vaishakh P At 11 June 2015 at 15:40 2025-12-02T04:32:08.151000

        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 best solutions below

        0
        AGE AGE On 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 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

        • Delay in loading Html Page(WebView) from assets folder in real android device
        • Why does a function show up as not defined
        • CSS Class is not applying to element (border width,color,and style attributes)
        • How to sort these using Javascript or Jquery Most effectively
        • how to fill out the table with next values in array with one button
        • Automatically closing tags in form input?
        • Positioning child at bottom of parent with scroll
        • Remove added set of rows
        • Website zoomed out on Android default browser
        • Twitter Bootstrap horizontal form elements on a line
        • http://sigmajs.org/ les mis tutorial - why are my canvases 0 height?
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • Svg containers not positioning properly

        Related Questions in CSS

        • CSS Class is not applying to element (border width,color,and style attributes)
        • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
        • Positioning child at bottom of parent with scroll
        • Play multiple audio files in a slider
        • How to set text over image?
        • Website zoomed out on Android default browser
        • Writing/Overwriting to specific XML file from ASP.NET code behind
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • CSS: Preventing a property to affect on element until the end of transition
        • Polygon Button with pure CSS
        • transform-origin doesnt apply in safari
        • show/hide multiple div tags at once and change the size of the remaining div tag
        • Mask the image/maps/div (circle) using css and jquery

        Related Questions in TABS

        • SWT CTabFolder doesn't display when running from eclipse
        • Composite Server Templates tabs
        • Preference Screen in SlidingTabLayout
        • Android: Table swipe in fragment goes too far
        • Is it possible for chrome to nest tabs within a tab?
        • Same Tab content over three different pages, how to active the coreesponding tabs according to the page id wordpress
        • How to add a WebView as a content to a tab in JavaFX?
        • Responsive Image on ionic Tab bar
        • Show table when its tab is clicked but hide other tables
        • Change TabItem's Header FontWeight
        • Can I force to keep the chrome tab open via extension?
        • Chrome.runtime.onMessage.addListener on new tab not receiving message from popup.js
        • Tabs in TabLayout not filling up entire ActionBar
        • jquery ui datepicker not working with tabs
        • ResponsiveTabs add onclick in js file

        Related Questions in HOVER

        • change a class:hover background-color with js
        • Internet Explorer hover/rgba/opacity/css3 compatibility
        • How to hover reciprocally on different elements with jquery.
        • How to create both onClick and mouseover to a link jQuery
        • CSS - Hover a container without pushing further elements down
        • Hover delay / Hover effect staying true after cursor leaving area of effect
        • Changing the hover behavior of dynamically generated classes
        • Pictures fade from BW to color while responsive
        • Dropdown menu with scroll not working on iPad
        • CSS :hover transform scale command rotate object instead
        • hover properties declaration confusion
        • svg rect doesnt respond with another div fixed with a high z-index
        • setTimeout dont work on .hover() leave/stop
        • Issue with HTML/CSS tab when it hover or active
        • Css Hover <a> inside <td>

        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)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

        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?

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Math
        • Aftereffectstemplates