Design Rectangles in 30 Colors on a Single Page

Margaret Jul 30, 2026

Have you ever wondered how to create a rectangle filled with color on a webpage? Whether you're designing a button, a background, or an important element of your website, understanding how to use color in a rectangle shape is a crucial skill in web development. In this article, we'll delve into the world of rectangle color pages, exploring how to create and manipulate these elements using HTML and CSS.

Rectangle Shape Coloring Page
Rectangle Shape Coloring Page

Before we dive into the details, let's briefly discuss the importance of color in web design. Color doesn't just make a webpage visually appealing; it also plays a significant role in conveying emotions, enhancing readability, improving navigation, and guiding users' attention. Therefore, mastering color application in rectangles is a vital aspect of creating user-friendly and engaging websites.

color the rectangles notebook with envelope and crayons coloring page for kids
color the rectangles notebook with envelope and crayons coloring page for kids

Rectangle Color Basics

To start, let's discuss the basics of rectangle color in web design. A rectangle can be filled with color using several CSS properties. The most common methods include `background-color`, and `fill`.

Trace and color the rectangle Coloring Page
Trace and color the rectangle Coloring Page

However, the versatility of CSS colors extends beyond these properties. You can create gradients, apply multiple colors, and even manipulate colors based on specific conditions using CSS. So, let's explore these aspects further.

Using `background-color` for Simple Colors

Rectangle Coloring Page for Kids — Doors, Books, Phones and Chocolate Bars
Rectangle Coloring Page for Kids — Doors, Books, Phones and Chocolate Bars

The `background-color` property is the most straightforward way to fill a rectangle with a solid color. This property can be applied to any HTML element, including the `rect` SVG element, to fill it with a specific color.

For instance, you can create a simple red rectangle using the following CSS code:

```css rect { width: 200px; height: 100px; background-color: red; } ```

Applying Gradients with `fill`

trace the rectangles worksheet for kids to practice their handwriting and numbers
trace the rectangles worksheet for kids to practice their handwriting and numbers

If you want to create a gradient effect in your rectangle, you can use the `fill` property with the `linearGradient` element in SVG. This allows you to define a gradient that transitions smoothly between two or more colors.

Here's an example of creating a linear gradient from blue to purple in a rectangle:

```html ```

Advanced Rectangle Color Techniques

Rectangle Coloring Page
Rectangle Coloring Page

Now that you've mastered the basics, let's explore some advanced techniques to create more intricate color effects in your rectangles.

One way to achieve this is by combining multiple CSS properties to create complex color manipulations. You can use `border-image` to add colored borders, `box-shadow` to create depth, and `mix-blend-mode` to manipulate how your colors interact with the background.

Colorful Rectangle Coloring Page for Kids & Preschoolers
Colorful Rectangle Coloring Page for Kids & Preschoolers
a black and white square frame on a white background
a black and white square frame on a white background
the rectangle coloring page with an image of a square character holding his hands up
the rectangle coloring page with an image of a square character holding his hands up
Color the Rectangles Coloring Page (Free Printable PDF)
Color the Rectangles Coloring Page (Free Printable PDF)
Rectangles - Train
Rectangles - Train
a worksheet with the words rectangle and pictures to be used for writing
a worksheet with the words rectangle and pictures to be used for writing
Rectangle Coloring Page - Free rectangle Coloring Page For Kids
Rectangle Coloring Page - Free rectangle Coloring Page For Kids
Color the Rectangles Coloring Page
Color the Rectangles Coloring Page
the printable box for rectangleular prisms is shown in black and white
the printable box for rectangleular prisms is shown in black and white

Multicolored Rectangles with `border-image`

The `border-image` property allows you to insert a series of images or colors along the borders of a rectangle. This can create visually appealing, multicolored effects without resorting to complex CSS gradients or background images.

Here's an example of using `border-image` to create a multicolored border around a rectangle:

```css rect { width: 200px; height: 100px; border-image: url(borders.png) 30 round; border-width: 20px; } ```

Color Depth with `box-shadow`

The `box-shadow` property can add depth and dimension to your rectangles by casting a shadow that seems to emanate from the element. You can create compelling 3D effects by applying shadows in strategic locations and manipulating the `blur-radius`, `spread-radius`, and `shadow-color` properties.

To add a simple blue shadow to a rectangle, use the following CSS code:

```css rect { box-shadow: 2px 2px 2px blue; } ```

Remember, when designing with colors, always consider the user experience. Ensure that your rectangles are easily visible and distinguishable from their surroundings to maintain optimal accessibility.

Creating rectangle color pages is a fundamental aspect of web design that, once mastered, can elevate your projects to new levels of refinement and professionalism. By learning and applying the techniques outlined in this article, you'll be well on your way to crafting visually stunning and user-friendly webpages. So, go forth, experiment, and make your rectangles shine!