【发布时间】:2020-07-18 17:37:47
【问题描述】:
我想改变 css。当我更改 oncklick 函数的 continer 高度时,1 秒后返回相同的大小,并且当我在 1 秒内出现错误控制台刷新并且我看不到时。如何修复?我关闭了 livereload 插件。它会在 1 秒内刷新所有内容。
当我在 css 崩溃后将 {% now "U" %} 删除到 css 链接 rel 并且不起作用时,为什么?这是问题吗?
这是我的代码--->
base.html
<!DOCTYPE HTML>
<html>
<head>
<title>home</title>
</head>
<link rel="stylesheet" type="text/css" href="/static/css/style.css?{% now "U" %}" />
<body>
{% block content %}
{% endblock %}
<script src="/static/js/homescript.js"></script>
</body>
</html>
home.html
{% extends 'base.html' %}
<link rel="stylesheet" type="text/css" href="/static/css/style.css?{% now "U" %}" />
{% block content %}
<form action = '' method="post" novalidate="novalidate">
{% csrf_token %}
<div class="continer">
{% for field in form %}
{{ field.label_tag }}
{{ field }}
{{ field.errors }}
{% endfor %}
<input type="submit" name="register" id="btn" onClick = "document.querySelector('#continer').style.height = '200px';">
</div>
</form>
{% endblock %}
style.css
@import url("//cdn.web-fonts.ge/fonts/bpg-glaho-arial/css/bpg-glaho-arial.min.css");
html,body{
background-image: url("../img/test.jpg") ;
background-position: center center;
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
padding: 0;
margin: 0;
}
.continer {
position: absolute;
width: 300px;
height:400px;
background-color: blue;
}
.inp{
margin: 3px;
margin-left: 57px;
width: 180px;
height: 20px;
border-radius: 5px;
border: none;
outline: none;
}
input,label {
display:block;
font-family: "BPG Glaho Arial", sans-serif;
text-align: center;
}
.btn{
margin-bottom: 20px;
}
.errorlist{
background-color: red;
border-radius: 2px;
width: 220px;
list-style-type: none;
margin-left: 20px;
color:white;
text-align: center;
}
.errorlist li{
padding-right: 28px;
font-family: "BPG Glaho Arial", sans-serif;
}
【问题讨论】:
标签: javascript python html css django