삼각형 아이콘을 생성하는 HTML+CSS

墨辰丷
풀어 주다: 2023-03-29 17:46:01
원래의
1748명이 탐색했습니다.

이 글에서는 삼각형 아이콘을 그리는 데 필요한 HTML+CSS 관련 코드를 주로 소개합니다. 많은 웹 페이지에는 일반적으로 그림을 자르는 삼각형 아이콘이 있습니다. 관심 있는 분들은 여기에서 css3+html을 사용하여 참고할 수 있습니다.

렌더링을 먼저 살펴보세요:

아래 코드를 입력하세요:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        #test1 {   
            height:20px;   
            width:20px;   
            border-color:#FF9600 #3366ff #12ad2a #f0eb7a;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test2 {   
            height:0;   
            width:0;   
            overflow: hidden; /* 这里设置overflow, font-size, line-height */   
            font-size: 0;     /*是因为, 虽然宽高度为0, 但在IE6下会具有默认的 */   
            line-height: 0;  /* 字体大小和行高, 导致盒子呈现被撑开的长矩形 */   
            border-color:#FF9600 #3366ff #12ad2a #f0eb7a;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test3 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 transparent transparent transparent;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test4 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 transparent transparent transparent;   
            border-style:solid dashed dashed dashed;   
            border-width:20px;   
        }/*兼容IE6*/   
        #test5 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 #3366ff transparent transparent;   
            border-style:solid solid dashed dashed;   
            border-width:40px 40px 0 0 ;   
        }   
    </style>
</head>
<body>
    <p id="test1"></p><br>
    <p id="test2"></p><br>
    <p id="test3"></p><br>
    <p id="test4"></p><br>
    <p id="test5"></p><br>
</body>
</html>
로그인 후 복사

요약: 위 내용은 이 글의 전체 내용입니다. 모든 분들의 공부에 도움이 되기를 바랍니다.

관련 권장 사항:

CSS 를 사용하여 삼각형 및 평행사변형을 그리는 방법

CSS에 대한 자세한 설명삼각형 그리기화살표 패턴 기술 분석

CSS로 삼각형 그리기화살표

위 내용은 삼각형 아이콘을 생성하는 HTML+CSS의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!