Html+css to achieve pure text and buttons with icons

Html+css to achieve pure text and buttons with icons

This article summarizes the implementation methods of some basic page elements, which will be updated later. First of all, the most common thing we may encounter is the button cut-out. Buttons may have many appearances, but they can generally be divided into pure text buttons and buttons with icons. Let's talk about the implementation methods of these two types of buttons. The effect diagram is as follows:

The code is as follows:

XML/HTML CodeCopy content to clipboard
  1. </ pre > < pre   name = "code"   class = "html" > <!DOCTYPE html >      
  2. < html   lang = "zh-CN" >      
  3. < head >      
  4.    < title > Button Writing </ title >      
  5.    < meta   charset = "UTF-8" >      
  6.    < meta   http-equiv = "X-UA-Compatible"   content = "IE=Edge,chrome=1" >      
  7.    < link   rel = "stylesheet"   href = "css/style.css" >      
  8. < style   type = "text/css" >      
  9. a:hover{text-decoration: none;}
  10. .btn{
  11. display: inline-block;
  12. margin-top: 10px;
  13. padding: 10px 24px;
  14. border-radius: 4px;
  15. background-color: #63b7ff;
  16. color: #fff;
  17. cursor: pointer;
  18. }
  19. .btn:hover{
  20. background-color: #99c6ff;
  21. }
  22. .inbtn{
  23. border: none;
  24. }
  25. .bubtn{
  26. border: none;
  27. }
  28. .btn{
  29. font-style: normal;
  30. }
  31. .bgbtn span{
  32. margin-left: 10px;
  33. padding-left: 20px;
  34. background: url(images/edit.png) left center no-repeat;
  35. }
  36. .bgbtn02 img{
  37. margin-bottom: -3px;
  38. margin-right: 10px;
  39. }
  40. </ style >      
  41. </ head >      
  42. < body >      
  43. <!--<a>Tag button-->      
  44. <   href = ""   class = "btn" > aLabel button </ a >      
  45. <!--<input> tag button-->      
  46. < input   class = "inbtn btn"   type = "button"   value = "input label button" />      
  47. <!--<button> tag button-->      
  48. < button   class = "bubtn btn" > button tag button </ button >      
  49. <!--Any label button-->      
  50. < i   class = "ibtn btn" > i label button </ i >      
  51. <!--Button with background icon-->      
  52. <   href = ""   class = "bgbtn btn" >      
  53.    < span > Button with icon </ span >      
  54. </ a >      
  55. <   href = ""   class = "bgbtn02 btn" >      
  56.    < img   src = "images/edit.png" /> Button with icon
  57. </ a >      
  58. </ body >      
  59. </ html >      
As for the advantages and disadvantages of various labels, you still need to experience them. If you have any interesting buttons to write, let's realize them together.

<<:  Linux type version memory disk query command introduction

>>:  The actual process of implementing the guessing number game in WeChat applet

Recommend

Detailed process of building mysql5.7.29 on centos7 of linux

1. Download MySQL 1.1 Download address https://do...

HTML structured implementation method

DIV+css structure Are you learning CSS layout? Sti...

Nest.js authorization verification method example

Table of contents 0x0 Introduction 0x1 RBAC Imple...

Use render function to encapsulate highly scalable components

need: In background management, there are often d...

User needs lead to marketing-oriented design

<br />For each of our topics, the team will ...

Write a simple calculator using JavaScript

The effect is as follows:Reference Program: <!...

Use CSS to create 3D photo wall effect

Use CSS to create a 3D photo wall. The specific c...

MySQL big data query optimization experience sharing (recommended)

Serious MySQL optimization! If the amount of MySQ...

JavaScript canvas implements moving the ball following the mouse

This article example shares the specific code of ...

Summary of Vue 3 custom directive development

What is a directive? Both Angular and Vue have th...

CocosCreator ScrollView optimization series: frame loading

Table of contents 1. Introduction 2. Analysis of ...

Detailed explanation of basic interaction of javascript

Table of contents 1. How to obtain elements Get i...

Detailed explanation of encoding issues during MySQL command line operations

1. Check the MySQL database encoding mysql -u use...