Html+CSS drawing triangle icon

Html+CSS drawing triangle icon

Let’s take a look at the renderings first:

XML/HTML CodeCopy content to clipboard
  1. <!doctype html >   
  2. < html   lang = "en" >   
  3. < head >   
  4.      < meta   charset = "UTF-8" >   
  5.      < title > Document </ title >   
  6.      < style   type = "text/css" >   
  7. #test1 {
  8. height:20px;
  9. width:20px;
  10. border-color:#FF9600 #3366ff #12ad2a #f0eb7a;
  11. border-style:solid;
  12. border-width:20px;
  13. }
  14. #test2 {
  15. height:0;
  16. width:0;
  17. overflow: hidden; /* Set overflow, font-size, line-height here */
  18. font-size: 0; /*Because, although the width and height are 0, it will have the default size in IE6 */
  19. line-height: 0; /* Font size and line height, causing the box to appear as a stretched long rectangle */
  20. border-color:#FF9600 #3366ff #12ad2a #f0eb7a;
  21. border-style:solid;
  22. border-width:20px;
  23. }
  24. #test3 {
  25. height:0;
  26. width:0;
  27. overflow: hidden;
  28. font-size: 0;
  29. line-height: 0;
  30. border-color:#FF9600 transparent transparent transparent;
  31. border-style:solid;
  32. border-width:20px;
  33. }
  34. #test4 {
  35. height:0;
  36. width:0;
  37. overflow: hidden;
  38. font-size: 0;
  39. line-height: 0;
  40. border-color:#FF9600 transparent transparent transparent;
  41. border-style:solid dashed dashed dashed;
  42. border-width:20px;
  43. }/*Compatible with IE6*/
  44. #test5 {
  45. height:0;
  46. width:0;
  47. overflow: hidden;
  48. font-size: 0;
  49. line-height: 0;
  50. border-color:#FF9600 #3366ff transparent transparent;
  51. border-style:solid solid dashed dashed;
  52. border-width:40px 40px 0 0 ;
  53. }
  54.      </ style >   
  55. </ head >   
  56. < body >   
  57.      < div   id = "test1" > </ div > < br >   
  58.      < div   id = "test2" > </ div > < br >   
  59.      < div   id = "test3" > </ div > < br >   
  60.      < div   id = "test4" > </ div > < br >   
  61.      < div   id = "test5" > </ div > < br >   
  62. </ body >   
  63. </ html >   
  64.   

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  How to solve the problem of margin overlap

>>:  Problem of retrieving root password in MYSQL 5.7 under Linux (tested and available)

Recommend

Syntax alias problem based on delete in mysql

Table of contents MySQL delete syntax alias probl...

Detailed tutorial on installing pxc cluster with docker

Table of contents Preface Preliminary preparation...

Detailed tutorial on using the tomcat8-maven-plugin plugin in Maven

I searched a lot of articles online but didn'...

Introduction to Vue3 Composition API

Table of contents Overview Example Why is it need...

Application and implementation of data cache mechanism for small programs

Mini Program Data Cache Related Knowledge Data ca...

Detailed explanation of common methods of Vue development

Table of contents $nextTick() $forceUpdate() $set...

Implementation and optimization of MySql subquery IN

Table of contents Why is IN slow? Which is faster...

MySQL full-text search Chinese solution and example code

MySQL full text search Chinese solution Recently,...

Ubuntu 20.04 Chinese input method installation steps

This article installs Google Input Method. In fac...

Basic notes on html and css (must read for front-end)

When I first came into contact with HTML, I alway...

In-depth analysis of the Tomcat server of Centos 7 system

Table of contents 1. The origin of tomcat 1. Tomc...

Specific usage of CSS compound selectors

Intersection Selector The intersection selector i...

Implementing license plate input function in WeChat applet

Table of contents Preface background Big guess Fi...