Welcome to Bucaro TecHelp!

Bucaro TecHelp
HTTPS Encryption not required because no account numbers or
personal information is ever requested or accepted by this site

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Easy Oval Image Mask With CSS

Oval image mask with CSS

To give an image a beautiful oval shape does not require complicated image masking. With the CSS border-radius property, you can give an image, or any element, rounded corners.

border-radius Syntax

border-radius: [ <length> | <percentage> ]{1,4} [ / [ <length> |<percentage> ]{1,4} ]

At first appearance the border-radius syntax seems quite confusing. That's because the full blown expression can have eight values separated into two groups by a slash. The first four values before the slash define the horizontal radii for the top-left, top-right, bottom-right, and bottom-left corner, in that order.

The first four values before the slash define the vertical radii for the top-left, top-right, bottom-right, and bottom-left corner, in that order. These values can be expressed in any CSS unit length unit. They can also be expressed as a percentage of the length of the axes of an ellipsis that forms the corner.

But don't worry, to create a beautiful oval shaped image requires only one value - 50%. With one value all corners will be rounded equally, and the shape of the oval will depend upon the aspect ratio of your image. Of course if your image is perfectly square, you'll get a circle.

Shown below is an image tag with inline style to create an oval shape:

<img style="border-radius: 50%;" src="sunrise.jpg" />

More Easy Cascading Style Sheets:
• How to Color Alternating Rows or Columns in a Table
• How to Style a Table
• Add Style to Your Blockquotes
• Style Your Imagemap Tooltips
• Using the HSL Color Specification
• How to Center a DIV
• CSS to Use an Image as a Mask
• Create a Cool Picture Frame Effect with CSS
• Using Google Fonts
• Create Custom Horizontal Rules

RSS Feed RSS Feed

Follow Stephen Bucaro Follow @Stephen Bucaro


Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2024 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268