简体   繁体   English

我在使用 css 突出显示文本时遇到问题

[英]I am having problems with the css highlighting text

I am having problems with the css side of the hypertext link, the strings that transport you to the other pages of the website, they are not highlighting when I hover over the message, when it comes to the stuff, I cannot see the problems with the code, could i have some help with this please?:我在超文本链接的 css 一侧遇到问题,将您传输到网站其他页面的字符串,当我通过消息 hover 时,它们没有突出显示,当涉及到这些东西时,我看不到问题代码,我可以帮忙吗?

 ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { color: white; text-align: center; padding: 14px 16px; text-decoration: none; hover: red; } a { color: white; } } a:hover { color: red; }
 <u1> <li style="list-style-type: none;"><a href="Chocolate.html">Chocolate</a></li><br> <li style="list-style-type: none;"><a href="Mallow.html">Marshmallows</a></li><br> <li style="list-style-type: none;"><a href="Gummy.html">Gummy Candy</a></li><br> <li style="list-style-type: none;"><a href="Seasonal.html">Seasonal Candy</a></li><br> <li style="list-style-type: none;"><a href="Fizzy.html">Fizzy Candy</a></li><br> <li style="list-style-type: none;"><a href="Lollipops.html">Lollipops</a></li><br> <li style="list-style-type: none;"><a href="Chewy.html">Chewy Candy</a></li><br> <li style="list-style-type: none;"><a href="HardBoiled.html">Hard Boiled Candy</a></li><br> <li style="list-style-type: none;"><a href="New.html">Newest Selection</a></li><br> </u1>

  1. You have a typo, u1 instead of ul你有一个错字, u1而不是ul
  2. You have too many definitions of A so the hover is ignored, I removed a { color: white; }您对 A 的定义太多,因此忽略 hover,我删除a { color: white; } a { color: white; }
  3. Unnecessary inline list types on the LIs LI 上不必要的内联列表类型
  4. Don't use float and br when not using float and br does the same.不使用 float 和 br 时不要使用 float 和 br 也是如此。 I removed li { float: left; }我删除了li { float: left; } li { float: left; } and <br> li { float: left; }<br>

 ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li a { color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover { color: red; }
 <ul> <li><a href="Chocolate.html">Chocolate</a></li> <li><a href="Mallow.html">Marshmallows</a></li> <li><a href="Gummy.html">Gummy Candy</a></li> <li><a href="Seasonal.html">Seasonal Candy</a></li> <li><a href="Fizzy.html">Fizzy Candy</a></li> <li><a href="Lollipops.html">Lollipops</a></li> <li><a href="Chewy.html">Chewy Candy</a></li> <li><a href="HardBoiled.html">Hard Boiled Candy</a></li> <li><a href="New.html">Newest Selection</a></li> </ul>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM