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

SQL query for users who have logged in for at least n consecutive days

Take 3 consecutive days as an example, using the ...

Display special symbols in HTML (with special character correspondence table)

Problem Reproduction When using HTML for editing,...

How to build lnmp environment in docker

Create a project directory mkdir php Create the f...

Use of MySQL triggers

Triggers can cause other SQL code to run before o...

Vue implements picture verification code when logging in

This article example shares the specific code of ...

How to modify Flash SWF files in web pages

I think this is a problem that many people have en...

Detailed explanation of HTML programming tags and document structure

The purpose of using HTML to mark up content is t...

Basic operations of mysql learning notes table

Create Table create table table name create table...

Open the app on the h5 side in vue (determine whether it is Android or Apple)

1. Development environment vue+vant 2. Computer s...

Discussion on default margin and padding values ​​of common elements

Today we discussed the issue of what the margin v...

How to use docker to build redis master-slave

1. Build a Docker environment 1. Create a Dockerf...

Ideas and practice of multi-language solution for Vue.js front-end project

Table of contents 1. What content usually needs t...

What does this.parentNode.parentNode (parent node of parent node) mean?

The parent node of the parent node, for example, t...

Teach you how to quickly install Nginx in CentOS7

Table of contents 1. Overview 2. Download the Ngi...