Home > Web Front-end > HTML Tutorial > How to implement plain text and buttons with icons in Html+css

How to implement plain text and buttons with icons in Html+css

php中世界最好的语言
Release: 2018-01-24 09:56:50
Original
2919 people have browsed it

This time I will show you how to implement pure text and buttons with icons using Html+css. What are the precautions for implementing pure text and buttons with icons using Html+css? The following is a practical case. Let’s take a look.

This article summarizes the implementation methods of some basic page elements and will be updated in the future. First of all, the most common thing we encounter is the cutout of buttons. Buttons may have many appearances, but they can generally be divided into plain text buttons and buttons with icons. Let’s talk about the implementation methods of these two buttons.

<!DOCTYPE html>     
<html lang="zh-CN">     
<head>     
  <title>按钮写法</title>     
  <meta charset="UTF-8">     
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">     
  <link rel="stylesheet" href="css/style.css">     
<style type="text/css">     
  a:hover{text-decoration: none;}     
  .btn{     
    display: inline-block;     
    margin-top: 10px;     
    padding: 10px 24px;     
    border-radius: 4px;     
    background-color: #63b7ff;     
    color: #fff;     
    cursor: pointer;     
  }     
  .btn:hover{     
    background-color: #99c6ff;     
  }     
  .inbtn{     
    border: none;     
  }     
  .bubtn{     
    border: none;     
  }     
  .btn{     
    font-style: normal;     
  }     
  .bgbtn span{     
    margin-left: 10px;     
    padding-left: 20px;     
    background: url(images/edit.png) left center no-repeat;     
  }     
  .bgbtn02 img{     
    margin-bottom: -3px;     
    margin-right: 10px;     
  }     
</style>     
</head>     
<body>     
<!--<a>标签按钮-->     
<a href="" class="btn">a标签按钮</a>     
<!--<input>标签按钮-->     
<input class="inbtn btn" type="button" value="input标签按钮"/>     
<!--<button>标签按钮-->     
<button class="bubtn btn">button标签按钮</button>     
<!--任意标签按钮-->     
<i class="ibtn btn">i标签按钮</i>     
<!--带背景图标按钮-->     
<a href="" class="bgbtn btn">     
  <span>带图标按钮</span>     
</a>     
<a href="" class="bgbtn02 btn">     
  <img src="images/edit.png"/>带图标按钮     
</a>     
</body>     
</html>
Copy after login

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use HTML and CSS to make Dabai

##What are the commonly used tags in XHTML

How to use horizontal line annotations and code comments in HTML

The above is the detailed content of How to implement plain text and buttons with icons in Html+css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template