html与css基础

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);
}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值