How To Create A Triangle Using HTML and CSS?


STEP 1: Add <div class="triangle"></div> in the HTML document.

STEP 2: Add this CSS code.

.triangle{ 
 position: absolute;
 border-width: 50px;
 border-style: solid;
 border-color: transparent transparent black transparent;
 }

 

OUTPUT

 







Trending Posts

How To Create A Parallelogram Using HTML and CSS?

Easy Light Bulb Project: HTML, CSS, and JavaScript

How To Create A Magic 8 Ball Using HTML, CSS, and JavaScript?

The Secret to Flawless Web Design: Mastering Responsive Layouts

Difference Between Java and JavaScript: A Complete Guide

Will DeepSeek AI Replace Web Developers? A JavaScript Developer’s Reality Check

Create a Stunning Personal Portfolio Website with HTML & CSS

Creating Mjölnir Thor Hammer Using HTML and CSS

How To Create A Trapezium Using HTML and CSS?

8 Characteristics Of Modern Computer