DIV+CSS如何让字体自动变颜色?

html-css055

DIV+CSS如何让字体自动变颜色?,第1张

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<style>标签中,输入css代码:。

body {

animation: change 3s linear 0s infinite

}

@keyframes change {

0% {color: #333}

50% {color: #f60}

100% {color: #f00}

}

3、浏览器运行index.html页面,此时字体颜色会随着时间的变化而自动变化。

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<style>标签中,输入css代码:button {background-color: #00a7d0}

button:hover {background-color: #ff7701}。

3、浏览器运行index.html页面,此时显示出了蓝色背景颜色的按钮。

4、将鼠标移入按钮,此时按钮的背景颜色变成了橙色。