user1857492
user1857492

Reputation: 767

How to set border-radius just using border property

Is it possible to set border-radius of an element with just using border property?

I want the same result as below:

#myelement {
  border: 1px solid #535353;
  border-radius: 5px 5px 5px 5px;
}

I want some code like following (but below code does not work):

#myelement {
  border: 1px solid #535353 5px 5px 5px 5px;
}

And if you know the answer would you mind telling how you find the answer? I just couldn't find it in Google :(

Upvotes: 0

Views: 55

Answers (2)

Felix
Felix

Reputation: 38102

The syntax for border property is:

<br-width> || <br-style> || <color>

and the meaning of these values:

<br-width>
The width of the border of the elements. Default value medium is used if absent
<br-style>
The line style for all four sides of the elements border. Default value none is used if absent
<color>
Denote the color of the border. If not set, its default value is the value of the element's color property (the text color, not the background color)

So it's impossible to include border-radius inside border value

Upvotes: 3

InternalFX
InternalFX

Reputation: 1485

In short, Not possible.

Formal syntax: <br-width> || <br-style> || <color>

you should read Mozilla's Documentation for the border property

Upvotes: 4

Related Questions