我在main.css中的文本装饰不起作用。我试图改变标签的位置并添加这个标签几次,但它也不起作用。但它不起作用。
重要的事不起作用我不知道还能做什么
提前预约!
CSS代码:
body {
background: #2c2c2c;
}
aside {
float: left;
background: #181818;
width: 20%;
padding: 2.5%;
height: 100vh;
color: #fff;
border-right: 5px solid #4d4d4d;
}
aside img {
width: 80px;
float: left;
}
aside .logo {
font-size: 40px;
margin-left: 10px;
font-weight: bold;
position: relative;
top: -5px;
}
aside h3 {
margin-top: 50px;
font-size: 28px;
}
aside ul {list-style: none}
aside ul li {
color: #fff;
display: block;
margin-top: 20px;
transition: transform .6s ease;
}
li {text-decoration: none !important;}
aside ul li:hover, aside ul a:hover {
color: #eb5959;
transform: scale(1.05);
text-decoration: none;
}
字符串
HTML代码:
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{%endblock%}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{% static 'main/css/main.css' %}">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
</head>
<body>
<aside>
<img src="{% static 'main/img/logo(2).png' %}" alt="Лого">
<span class="logo">DecSam</span>
<h3>Навигация</h3>
<ul>
<a href=""><li><i class="fas fa-home"></i>Главная</li></a>
<a href=""><li><i class="fas fa-address-book"></i>Про нас</li></a>
<a href="mailto:[email protected]"><li><i class="fas fa-paper-plane"></i>Связаться с нами</li></a>
</ul>
</aside>
<main>
{% block content%}
{% endblock %}
</main>
</body>
</html>
型
1条答案
按热度按时间fnvucqvd1#
替换你的CSS行:
li {text-decoration:none!important;}您的代码不正确请替换为以下代码
个字符