Principle: Draw a Div, give the div a width of 0, give 4 border attributes, three of which can be hidden to get a triangle.
Very simple one principle, the project may rarely use, the amateur can play, in fact, the front end is very good to play. can achieve a variety of functions.
Css:
1{2 width: 0; 3 height: 0; 4 border-right: 50px solid transparent; 5 border-bottom: 50px solid blue; 6 border-left: 50px solid transparent; 7 }
Html:
1 < class= "Test1"></div>
All code:
1 <!DOCTYPE HTML>2 <HTML>3 4 <Head>5 <MetaCharSet= "UTF-8">6 <title></title>7 </Head>8 <!--/*1.css style * / -9 <styletype= "Text/css">Ten . Test1{ One width:0; A Height:0; - Border-right:50px Solid Transparent; - Border-bottom:50px Solid Blue; the Border-left:50px Solid Transparent; - } - - . Test2{ + width:0; - Height:0; + Border-top:50px Solid Transparent; A Border-bottom:50px Solid Transparent; at Border-left:50px Solid Orange; - } - - . Test3{ - width:0; - Height:0; in Border-top:50px solid Black; - Border-right:50px Solid Transparent; to Border-left:50px Solid Transparent; + } - the . Test4{ * width:0; $ Height:0;Panax Notoginseng Border-top:50px Solid Transparent; - Border-right:50px Solid Red; the Border-bottom:50px Solid Transparent; + } A </style> the + <Body> - <!--2.html Style - $ <Divclass= "Test1"></Div> $ <Divclass= "Test2"></Div> - <Divclass= "Test3"></Div> - <Divclass= "Test4"></Div> the </Body> - Wuyi </HTML>View Code
Today, on January 9, 2018, Brother Pony became our consultant. It's not our boss anymore. Well, you can have a meal.
is not to become mature point, Sao years.
Css_ Draw a triangle