如何解决语义UI site.variables位置?
我有一个Django / Python应用程序,我想在视图中使用语义UI。我正在使用CDN链接导入语义,因此我的基本HTML文件具有以下标头...
<head>
...
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{% static "styles.css" %}">
...
</head
您可能会看到我想加载Google字体。但是,默认情况下,所有语义UI元素似乎都使用Lato,'Helvetica Neue',Arial,Helvetica,sans-serif
字体,并且很难覆盖。
我在网上看到的所有建议都告诉我“ 自定义site.variables
文件”。但是此site.variables
文件在哪里?是我做的东西吗?如果是的话,我应该放在哪里,以便语义UI可以检测到它?
更新:这是我的CSS
html {
font-family: 'Montserrat',sans-serif;
}
解决方法
错误在这里。
class User:
def __init__(self,first_name,last_name,age,weight,race):
self.first_name = first_name
self.last_name = last_name
self.age = age
self.weight = weight
self.race = race
self.login = 0
def describe_user(self):
print("The following infoation is about this user")
print(f"\t{self.first_name}")
print(f"\t{self.last_name}")
print(f"\t{self.age} years old")
print(f"\t{self.weight} lbs")
print(f"\t{self.race}")
def greet_user(self):
full_name = f"{self.first_name} {self.last_name}"
print(f"Nice to meet you {full_name}")
def login_attempts(self):
"""Print a statement and show the current attempts"""
print(f"Current login attempt {self.login}")
def increment_login_attempts(self):
"""Increase login attempt by 1 everytime"""
self.login += 1
def reset_login_attempts(self):
"""Resrt the value"""
self.login = 0
class Privileges:
def __init__(self,privileges):
"""Initilize attributes to the class"""
self.privileges = ['can add post','can delete post','can ban user']
def show_privileges(self):
"""Show the current priviledges list"""
print(self.privileges)
class Admin(User):
def __init__(self,race):
"""
Initialize attributes of the parent class.
Then initizalize attributes specific to an electric car.
"""
super().__init__(first_name,race)
self.privileges = Privileges()
# def add_privileges(self,privileges):
# """Add privileges to the list"""
# for privilege in privileges:
# self.privileges.append(privilege)
user_01 = Admin('Edward','Li',18,150,'Asian')
user_01.privileges.show_privileges()
应为href="{% static "styles.css" %}"
。
您不能在双引号内使用双引号。
您可能还想使用href="{% static 'AppName/styles.css' %}"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。