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 explanation of meta tags (the role of meta tags)

No matter how wonderful your personal website is,...

Summary of js execution context and scope

Table of contents Preface text 1. Concepts relate...

How to successfully retrieve VMware Esxi root password after forgetting it

Prepare a CentOS6 installation disk (any version)...

XHTML tags have a closing tag

<br />Original link: http://www.dudo.org/art...

Summary of 6 skills needed to master web page production

It has to be said that a web designer is a general...

Detailed explanation of nginx shared memory mechanism

Nginx's shared memory is one of the main reas...

HTML optimization techniques you must know

To improve the performance of web pages, many dev...

Tutorial on how to quickly deploy a Nebula Graph cluster using Docker swarm

1. Introduction This article describes how to use...

Simple use of Vue bus

Simple use of Vue bus Scenario description: Compo...

Detailed explanation of JavaScript data types

Table of contents 1. Literals 1.1 Numeric literal...

Vue: Detailed explanation of memory leaks

What is a memory leak? A memory leak means that a...

JavaScript design pattern learning adapter pattern

Table of contents Overview Code Implementation Su...

A brief analysis of the basic concepts of HTML web pages

What is a web page? The page displayed after the ...

Three ways to forward linux ssh port

ssh is one of the two command line tools I use mo...

Implementation of Nginx configuration of multi-port and multi-domain name access

To deploy multiple sites on a server, you need to...