Home » Blog » CSS 3: how to style element borders?

CSS 3: how to style element borders?

TCSS 3 also includes the Backgrounds and Borders module , which is almost ready. Let’s look at the practicalities of styling element borders in CSS 3.

The aesthetic level of the website

must be taken care of, a quality design must not lack imagination, a nice background or elegant edges. A graphic web design proposal that fulfilled all these requirements to a great extent, but was often not at all easy to implement, and web designers therefore had to help each other with JavaScript and complicated HTML code editing. But now a new era is coming.

As it was written in perex, CSS 3 also includes the Backgrounds and Borders module , which can greatly facilitate the work of web designers when shaping the design. This module is already practically ready and there sweden phone number data are already implementations of it in all major browsers (in IE from the ninth version). The new features contained in it have already become familiar, Interval briefly reported on them five years ago . So now it’s slowly time to think about how to make the best use of them. The next two chapters will hopefully be a good inspiration.

phone number data

Round corners
We come across rounded corners on many websites, but mostly it is a classic symmetrical rounding, which already looks a bit dull. Thanks develop an effective link building strategy to the properties border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radiusand border-bottom-left-radiuswe will be able to playfully create unconventional rounding of corners. One of the interesting renderings ( border-radius: 2em 9px) is in the first picture:

Element with rounded corners

Figure 1: Unconventional corner rounding.

Thanks to the fact that the horizontal and vertical radius can be set differently (both values ​​are separated by a slash, border-radius: 8em/4exe.g. instead of rounding the transition between different border widths of adjacent sides.

Oval shape of the elements

When it comes to the appearance of the element’s borders, CSS 2 doesn’t offer us much. The option to incorporate some images into the border is especially noticeably missing. So, in this sense, the property border-imageis a bw lists godsend. First, let’s explain how the image border works. We will virtually divide the image we intend to use into nine parts (shown in Figure 3): 4 corners, 4 edges and the center.

Scroll to Top