.txt01{font:Verdana, Geneva, sans-serif,宋体;padding:3px 2px 2px 2px; border-width:1px; border-color:#ddd; color:#000;}这段css代码有什么错误吗?
时间: 2023-06-09 12:05:40 浏览: 51
这是一个CSS样式,设置了一个名为".txt01"的元素的字体为"Verdana, Geneva, sans-serif,宋体",上下左右的内边距分别为3px、2px、2px、2px,边框宽度为1px,边框颜色为默认颜色。
相关问题
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>登录界面</title> <style> body { margin: 0; padding: 0; background-color: #f2f2f2; font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; } #page_login { display: flex; justify-content: center; align-items: center; height: 100vh; } .loginContainer { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: white; border-radius: 5px; box-shadow: 0px 0px 10px rgba(0,0,0,0.2); padding: 30px; } .loginContainer > div { font-size: 36px; margin-bottom: 20px; text-align: center; } input[type="text"], input[type="password"] { width: 100%; padding: 10px; margin-bottom: 10px; border: none; border-radius: 5px; box-shadow: 0px 0px 5px rgba(0,0,0,0.1); } #loginButton { background-color: #007bff; color: white; padding: 10px 20px; border: none; border-radius: 5px; box-shadow: 0px 0px 5px rgba(0,0,0,0.1); transition: all 0.2s ease-in-out; } #loginButton:hover { transform: scale(1.05); box-shadow: 0px 0px 10px rgba(0,0,0,0.2); } </style> </head> <body> <!-- 登录界面 --> <div id="page_login"> <div class="loginContainer"> <div>Login</div> <input type="text" name="account" id="account" placeholder="account"> <input type="password" name="password" id="password" placeholder="password"> <button id="loginButton" onclick="getLogin()">login</button> </div> <button id="checkinto">select</button> </div> </body> <script> document.getElementById('checkinto').addEventListener('click', function() { window.location.href = 'select.html'; }); </script> <script type="text/javascript" src="./js/index.js"></script> <script src="./js/jquery-3.3.1.js"></script> </html>美化这段代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>登录界面</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #f2f2f2;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}
#page_login {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.loginContainer {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: white;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
padding: 30px;
}
.loginContainer > div {
font-size: 36px;
margin-bottom: 20px;
text-align: center;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: none;
border-radius: 5px;
box-shadow: 0px 0px 5px rgba(0,0,0,0.1);
}
#loginButton {
background-color: #007bff;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
box-shadow: 0px 0px 5px rgba(0,0,0,0.1);
transition: all 0.2s ease-in-out;
}
#loginButton:hover {
transform: scale(1.05);
box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<!-- 登录界面 -->
<div id="page_login">
<div class="loginContainer">
<div>Login</div>
<input type="text" name="account" id="account" placeholder="账号">
<input type="password" name="password" id="password" placeholder="密码">
<button id="loginButton" onclick="getLogin()">登录</button>
</div>
<button id="checkinto">选择</button>
</div>
</body>
<script>
document.getElementById('checkinto').addEventListener('click', function() {
window.location.href = 'select.html';
});
</script>
<script type="text/javascript" src="./js/index.js"></script>
<script src="./js/jquery-3.3.1.js"></script>
</html>
css的font-family可以设置哪些,比较常用
在CSS中,font-family属性可以用于设置不同的字体。以下是一些常用的字体系列:
1. "Arial, Helvetica, sans-serif":Arial字体,如果没有安装则使用Helvetica字体,如果都没有则使用系统默认的无衬线字体。
2. "Times New Roman, Times, serif":Times New Roman字体,如果没有安装则使用Times字体,如果都没有则使用系统默认的衬线字体。
3. "Courier New, Courier, monospace":Courier New字体,如果没有安装则使用Courier字体,如果都没有则使用系统默认的等宽字体。
4. "Verdana, Geneva, sans-serif":Verdana字体,如果没有安装则使用Geneva字体,如果都没有则使用系统默认的无衬线字体。
这些是一些常见的字体系列,可以根据需要自由组合和调整。在使用font-family属性时,通常会提供多个备选字体,以确保在用户设备上始终能够显示合适的字体。