---
title: "HTML Graphics using HTML"  
description: "HTML and CSS can be used to create basic shapes and simple graphics, for more complex and dynamic graphics."  
author: "Ashutosh Patel"  
published: 2024-06-10  
updated: 2024-06-10  
canonical: https://www.mindstick.com/articles/336067/html-graphics-using-html  
category: "html"  
tags: ["html", "html5", "graphic design", "html graphics"]  
reading_time: 2 minutes  

---

# HTML Graphics using HTML

### HTML Graphics

HTML obviously limits [graphics](https://www.mindstick.com/interview/1206/give-an-example-of-new-elements-in-html5-to-support-multimedia-and-graphics), as HTML is mainly used for [content organization](https://answers.mindstick.com/qa/105811/what-are-the-advantages-of-using-pinterest-boards-for-content-organization) and presentation rather than complex graphics. However, you can still create simple graphics with **HTML** and **CSS**, especially with the help of basic **shapes**, **colors**, and **positioning**.

## Example-

Here is a basic example to demonstrate HTML graphics design using HTML and CSS

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Graphics Example</title>
    <style>
        /* CSS styles for the circle */
        .circle {
            width: 100px;
            height: 100px;
            background-color: red;
            border-radius: 50%; /* Creates a circle */
        }
       /* CSS styles for the rectangle */
        .rectangle {
            width: 150px;
            height: 100px;
            background-color: blue;
        }
        /* CSS styles for the triangle */
        .triangle {
            width: 0;
            height: 0;
            border-left: 50px solid transparent;
            border-right: 50px solid transparent;
            border-bottom: 100px solid green;
        }
    </style>
</head>
<body>

<h2>HTML Graphics Example</h2>

<!-- Simple shapes created using HTML and CSS -->
<div class="circle"></div>
<div class="rectangle"></div>
<div class="triangle"></div>

</body>
</html>
```

## In the example above-

- The red circle is created using a [div element](https://www.mindstick.com/forum/34450/remove-div-element) with a **rectangular circle**, and its appearance is defined using CSS methods.
- The **blue rectangle** is created using the div element of the class **rectangle**.
- The **green rectangle** is created using a div element with **rectangular rectangles**, and its appearance is defined using **CSS borders**.

## Output-

![HTML Graphics using HTML](https://www.mindstick.com/mindstickarticle/ae7787df-d594-4309-b513-fc1b20bce899/images/7a48c1ed-1c98-4c04-a58e-5f3b4fa0a83f.jpg)

\
While basic shapes and simple graphics can be created using **HTML** and **CSS**, for more complex and dynamic graphics you will often use, or consider using, a **[JavaScript](https://www.mindstick.com/forum/12869/how-to-c-sharp-and-javascript-email-validation-regex) [library](https://www.mindstick.com/articles/157275/passed-peoplecert-it-infrastructure-library-itil-4-foundation-exam-today)** such as **SVG** (**[Scalable](https://answers.mindstick.com/blog/37/design-patterns-building-scalable-and-maintainable-software) Vector Graphics**) or canvas graphics [software](https://www.mindstick.com/articles/105988/how-field-ap-and-fieldtwin-software-can-help-managing-all-tasks-in-oil-and-energy-industry) will be used to export images for display on [your website](https://yourviews.mindstick.com/view/85950/why-organic-search-is-the-game-changer-for-your-website).

**Also, Read:** [How to display Base64 images in HTML](https://www.mindstick.com/articles/336066/how-to-display-base64-images-in-html)

---

Original Source: https://www.mindstick.com/articles/336067/html-graphics-using-html

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
