css和html基础
由于这是自己个人写作业时弄的,没有任何基础所以知识点比较杂,只是自己简单的做个笔记
在html引用css:
<link rel="stylesheet" href="./软考通知.css">
在html中引用css样式:
class标签
在文字下方加入横线:
border-bottom: 1px solid;
html全屏背景:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style>
body{
background-image: url(img/untitled.png);
background-repeat: no-repeat; #定义了图像的平铺模式。 no-repeat:背景图像将仅显示一次。
background-size: cover;
}
</style>
<body>
</body>
</html>
html设置自定义字体
首先在css创建一个字体:
@font-face {
font-family: 'h2_font'; #字体名字
src: url('./fonts/lianmeng.ttf');#下载字体的路径
}
h1{
font-size: 40px;
text-align: center;
line-height: 4rem;
font-family: h1_font; #引用字体
color: rgb(209, 141, 114);
}