CSS outline ๐ CSS border
In this thread I will explain the difference and when to use which one๐งต
In this thread I will explain the difference and when to use which one๐งต
2. We can use the border-radius property to round the corners. The outline does not support this.
But, firefox has -moz-outline-radius property. It allows rounded corners on the outline. This property is not defined in any CSS standard and is not supported by other browsers.
But, firefox has -moz-outline-radius property. It allows rounded corners on the outline. This property is not defined in any CSS standard and is not supported by other browsers.
3. The best thing about borders is, that we can change the properties like style, width, color, and radius of individual sides. This we can not do in outline.
4. Outline supports offset property which we can not use at the border.
Except Internet Explorer, all the other browsers support outline-offset.
Except Internet Explorer, all the other browsers support outline-offset.
5. Outlines may be non-rectangular in nature, unlike borders.
Well, this is the most confusing difference I came across. Let me try to explain this.
In border, if the box gets split over several lines, the browser just leaves the edges open because the box isn't closed.
Well, this is the most confusing difference I came across. Let me try to explain this.
In border, if the box gets split over several lines, the browser just leaves the edges open because the box isn't closed.
Outlines are generally used to indicate focus or active states of the elements such as buttons, links, etc.
As they don't make layout changes, they are ideal for highlighting.
As they don't make layout changes, they are ideal for highlighting.
Thanks for reading this thread till the end ๐
๐Bookmark this thread for the future.
๐ Retweet the first tweet.
๐Follow @PriteshKiri for more daily web development tips and tricks
#codewithcoffee #codewithcoffeeindia
๐Bookmark this thread for the future.
๐ Retweet the first tweet.
๐Follow @PriteshKiri for more daily web development tips and tricks
#codewithcoffee #codewithcoffeeindia
Loading suggestions...