难以解释,模仿此链接栏的悬停效果

时间:2018-09-10 07:34:52

标签: html css hover

因此,如果您将鼠标悬停在“家庭”和“产品”之间,则会看到底部边框,并且该边框似乎跟随光标。谁能想到我可以将其应用于整个链接栏,以便将鼠标悬停在这些链接上时边框基本上跟随鼠标吗?

#linkbar {
  width: 54%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.linklist {
  list-style-type: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  display: flex;
}

.linklist li {
  font: normal 1.6em 'Nanum Myeongjo', serif;
  padding: 0;
  width: 100%;
  border-right: 1px solid black;
  position: relative;
  top: 0;
}

.linklist a {
  text-decoration: none;
  color: black;
  display: block;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  border-bottom: 1px solid transparent;
  transition: border .3s, color .2s;
}

.linklist li:last-child {
  border-right: none;
}

.linklist a:hover {
  color: maroon;
  display: block;
}

.linklist a:after {
  content: '';
  width: 0px;
  height: 1px;
  display: block;
  background: maroon;
  transition: .3s;
  position: absolute;
  bottom: 0;
}

.linklist a:hover:after {
  width: 100%;
}

.home:after {
  right: 0;
}
<div id="linkbar">
  <ul class="linklist">
    <li><a class="home" href="#">Home</a></li>
    <li><a href="#">Products</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Contact</a></li>
    <li><a href="#">Events</a></li>
    <li><a href="#">Blog</a></li>
  </ul>
</div>
<!--linkbar-->

让我知道您是否还有其他需要。感谢您提供的任何帮助。我仍在学习CSS的原理,现在只是在选择器的表面上摸爬滚打

1 个答案:

答案 0 :(得分:0)

我已编辑代码。我认为这会帮助您。

SqlException: A new transaction is not allowed, because other threads are running in this session.
    using (anvizdbEntities db = new anvizdbEntities())
    {
        var devices = db.FingerClients;
        foreach (FingerClient d in devices)
        {
            Anviz.SDK.AnvizManager am = new Anviz.SDK.AnvizManager(d.IPaddress, Convert.ToUInt64(d.Clientid, 10));
            am.Connect();

            Anviz.SDK.Statistic statistic = am.GetDownloadInformation();
            if (statistic.NewRecordAmount > 0 && d.Clientid.Equals("1"))
            {
                List<Anviz.SDK.Record> records = am.DownloadRecords(count, (int)Anviz.SDK.TYPE_RECORDS.NEW_RECORDS);
                if (records != null)
                {

                    int max = db.Checkinouts.Max(check => check.Logid);
                    foreach (Anviz.SDK.Record r in records)
                    {
                        max++;

                        Checkinout checkinout = new Checkinout();
                        checkinout.Logid = max;
                        checkinout.Userid = r.UserCode.ToString();
                        checkinout.CheckTime = new DateTime((long)r.DateTime);
                        checkinout.WorkType = (int)r.WorkType;
                        checkinout.OpenDoorFlag = Convert.ToBoolean(r.RecordType);
                        checkinout.AttFlag = 1;
                        checkinout.Sensorid = d.Clientid;
                        checkinout.CheckType = "I";

                        Console.WriteLine("ADD RECORD {0}", max);
                        db.Checkinouts.Add(checkinout);
                    }
                    db.SaveChanges();
                }
            }
        }
    }