wolegca.github.io/index.html
2019-09-14 16:44:41 +08:00

64 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="myui.css">
<title>LAOZHONGYI BLOG</title>
</head>
<body>
<div id="blog-title">AHPU 老中医的博客</div>
<input type="checkbox" id="menu-control">
<div class="menu-container">
<ul>
<li><a href="/">首页</a></li>
<li><span>关于</span></li>
<li><label for="menu-control">返回</label></li>
</ul>
</div>
<label for="menu-control" class="content-mask"></label>
<label for="menu-control" class="menu-button-container">
<div class="menu-button">
<span></span>
<span></span>
<span></span>
</div>
</label>
<div class="content-border">
<div class="content">
<span>笔记1</span>
<p>在浏览网页的时候我们时常会看到一段文字的第一个字有下沉的效果。那么是如何实现的那下面小编给大家分享一下CSS如何实现首字下沉效果</p>
<p>首先准备一个HTML文档然后在文档中准备好一段文字如下图所示</p>
<img src="images/note1/1.jpg" alt="截图1">
<p>接下来就去除浏览器的间隙将margin以及padding都设置为0。然后设置body的样式如下图所示设置字体以及字体颜色样式接下来就是设置文字段落的样式了设置行间距段落宽度等。然后定位到p元素的first-child然后找到其第一个字这里用到的是first-letter如下图所示
</p>
<img src="images/note1/2.jpg" alt="截图2">
<p>最后我们运行以后,你会看到如下图所示的效果,第一个字是不是下沉了</p>
<p>综上所述实现首字下沉效果主要运用了CSS的first-letter选择器给其添加样式即可</p>
</div>
<div class="content">
<span>笔记2</span>
</div>
<div class="content">
<span>笔记3</span>
</div>
<div class="content">
<span>笔记4</span>
</div>
</div>
<!-- <div class="mask"></div> -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="drag.js"></script>
<script src="base.js"></script>
</body>
</html>