Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. active link css styling

active link css styling

Scheduled Pinned Locked Moved Bug Reports
2 Posts 2 Posters 80 Views
  • 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.
  • A Offline
    A Offline
    andrederbeiler
    wrote on last edited by
    #1

    Hey, i have got some custom html and css code on my website to make a custom menu. I would like to style the active style of the links properly but it does not seem to work with :active{}.
    is there a chance to get this running with pure css and html?

    this is the line that does not seem to do anything (it is at the end of my custom css):
    .nav-link a:active{
    color: hsla(0, 0%, 100%, 1);
    }

    this is my website and below that you will find my custom code:
    https://andrebeiler.work (the menu is custom made)

    Custom HTML at top:
    <div class="top">
    <a href="/" class="link-3">André Beiler</a>
    <div class="nav-2">
    <a href="/foto" class="nav-link">Fotographie</a><span class="komma">, </span>
    <a href="/film" class="nav-link">Musikvideo</a><span class="komma">, </span>
    <a href="#" class="nav-link">Archiv</a><span class="komma">, </span>
    <a href="/snaps" class="nav-link">Snaps</a><span class="komma">, </span>
    <a href="/about" class="nav-link">Über Mich</a><span class="komma">, </span>
    <a href="/about" class="nav-link">Kontakt</a>
    </div>
    </div>

    Custom CSS:.top {
    font-family: 'NeueHaasDisplayRoman', sans-serif;
    position: fixed;
    left: 0%;
    top: 0%;
    right: 0%;
    bottom: auto;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 0px;
    padding-left: 20px;
    z-index: 999999999;

    }

    .link-3 {
    text-decoration: none;
    font-size: 1em; /* Set the font size to 1em /
    line-height: 0.95;
    color: hsla(0, 0%, 100%, 0.6);
    transition: color 0.3s cubic-bezier(0.075, 0.82, 0.165, 1); /
    Use "in out circ" timing function for color */
    }

    .link-3:hover {
    color: hsla(0, 0%, 100%, 1);
    }

    .nav-2 {
    display: flex;
    margin-top: 2px;
    }

    .nav-link,
    .komma {
    font-size: 1.3em; /* Set the font size to 1.3em /
    line-height: 0.95;
    text-decoration: none;
    color: hsla(0, 0%, 100%, 0.6);
    transition: color 0.3s cubic-bezier(0.075, 0.82, 0.165, 1); /
    Use "in out circ" timing function for color */
    }

    .nav-link:hover {
    color: hsla(0, 0%, 100%, 1);
    }

    .komma {
    margin-right: 4px; /* Adjust the margin as needed */
    }

    .lay-projectindex-row.hover{
    font-family: 'NeueHaasDisplayRoman', sans-serif;
    }

    .nav-link a:active{
    color: hsla(0, 0%, 100%, 1);
    }

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      the css selector :active is only applied while clicking on a link during mousepress

      meaning when you release your finger from your mouse, its not styled in that way anymore

      so :active has nothing to do with the current page's active menu point

      read this please:
      https://laytheme.com/documentation/custom-css-styling.html#css-based-on-current-page

      some body html classes change, depending on what page you are on
      you can use this to style your links differently (active style) depending on what page you are on

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      I also code custom websites or custom Lay features.
      💿 Email me here: 💿
      info@laytheme.com

      Before you post:
      1. When using a WordPress Cache plugin, disable it or clear your cache.
      2. Update Lay Theme and all Lay Theme Addons
      3. Disable all Plugins
      4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

      This often solves issues you might run into

      When you post:
      1. Post a link to where the problem is
      2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
      3. If the problem is difficult to explain, post screenshots / link to a video to explain it
      Online Users
      A
      alasdair17
      Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
      laytheme.com
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Recent
      • Tags
      • Popular
      • Users
      • Search