css三角形

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>三角形制作title>
    <style type="text/css">
        h1 {
      
            position: relative;
            padding-left: 50px;
        }
        h1:after {
      
            content: '';
            display: inline-block;
            width: 0;
            height: 0;
            border: 20px solid transparent;
            border-top-color: #F00;
            position: absolute;
            left: 0px;
            top: 20px;
        }
    style>
head>
<body>
<h1>一级标题h1>
body>
html>

 

你可能感兴趣的:(前端)