Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #575984

    Hello. I have been playing around with this CSS link hover. I can’t seem to figure out how to alter the code so that the items display horizontally instead of vertically:

    CSS:

    ul#menu2 {
        list-style-type: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background-color: none;
    }
    
    ul#menu2  li a {
        position: relative;
        display: inline-block;
        color: white;
        text-align: left;
        padding: 9px 1px;
        text-decoration: none;
        font-size: 14px;
    }
    
    ul#menu2 li a::after {
    	position: absolute;
    	bottom: 150%;
    	left: 0;
            width: 100%;
            height: 1px;
    	background: #fff;
    	content: '';
    	opacity: 0;
    	-webkit-transition: height 0.3s, opacity 0.3s, -webkit-transform 0.3s;
    	-moz-transition: height 0.3s, opacity 0.3s, -moz-transform 0.3s;
    	transition: height 0.3s, opacity 0.3s, transform 0.3s;
    	-webkit-transform: translateY(-10px);
    	-moz-transform: translateY(-10px);
    	transform: translateY(-10px);
    }
    
    ul#menu2 li a:hover::after,
    ul#menu2 li a:focus::after,
    ul#menu2 li a:active::after {
    	height: 5px;
    	opacity: 1;
    	-webkit-transform: translateY(0px);
    	-moz-transform: translateY(0px);
    	transform: translateY(0px);
    }

    HTML in code block:

    <ul id="menu2">
      <li><a href="#home">born out of necessity</a></li>
      <li><a href="#news">identifying the need</a></li>
      <li><a href="#contact">implications</a></li>
      <li><a href="#about">breaking down user psychology</a></li>
      <li><a href="#about">research driven development</a></li>
      <li><a href="#about">survey and poll data</a></li>
    </ul>

    Do you think you guys can help make it so that the elements display in a horizontal line rather then on top of one another?

    #578357

    Hey peanuttario!

    Thank you for using Enfold.

    Please add this in the Quick CSS field:

    ul#menu2 li {
        display: inline;
    }

    Cheers!
    Ismael

    #578829

    Thanks! It worked, however the hover animation is no longer working for some reason…

    #578939

    Hello. You can close this thread. I’ve found an alternative CSS that works much better than the one above. thanks guys!

    #579384

    Hi,

    Great, glad you found a solution.

    Best regards,
    Rikard

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘help with custom menu hover bar’ is closed to new replies.