update
This commit is contained in:
parent
c327c85d6f
commit
b36423ff5f
17
index.css
17
index.css
@ -30,8 +30,9 @@ div.menu-container {
|
||||
padding-top: 50px;
|
||||
transition: all .5s ease;
|
||||
overflow: hidden;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
z-index: 1
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
z-index: 1;
|
||||
box-shadow: 2px 0px 8px black
|
||||
}
|
||||
|
||||
div.menu-container ul {
|
||||
@ -50,18 +51,18 @@ div.menu-container ul li {
|
||||
|
||||
div.menu-container ul li * {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
color: white;
|
||||
display: block;
|
||||
padding: 8px 0 0;
|
||||
transition: all .5s ease;
|
||||
transition: all .3s ease;
|
||||
font-size: 24px;
|
||||
height: 40px;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
div.menu-container ul li *:hover {
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
color: white
|
||||
background-color: rgba(255, 255, 255, .2);
|
||||
/*color: black*/
|
||||
}
|
||||
|
||||
div.menu-container ul>li+li:before {
|
||||
@ -91,7 +92,7 @@ label[for=menu-control].content-mask {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
background-color: rgba(25, 25, 25, .9);
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
float: left;
|
||||
z-index: 1;
|
||||
transition: all .5s ease;
|
||||
@ -124,7 +125,7 @@ div.content {
|
||||
max-width: 800px;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
opacity: .5;
|
||||
opacity: 1;
|
||||
transition: opacity .5s ease, transform .5s ease;
|
||||
cursor: pointer;
|
||||
padding: 15px;
|
||||
|
@ -35,8 +35,7 @@
|
||||
<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>
|
||||
<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>
|
||||
|
Loading…
Reference in New Issue
Block a user