A
A
Alexander Lozovsky2017-03-06 23:24:58
css
Alexander Lozovsky, 2017-03-06 23:24:58

How can I set the border-radius to the element's height if it's not explicitly set?

I would like to make the border radius always equal to the height of the element. Please tell me how to implement this using js (I didn’t succeed with css or less). That is, in less you can of course set @height: 50px; and then height: @height; border-radius: @height; . And I mean not to set height at all , well, or height: auto; , something like this.
At the level of logic, it is clear that you need to get the height value of the element and then write it to the border-radius , but how to write it syntactically correctly (preferably without jQuery) ? Tell a beginner please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Azim Kurt, 2017-03-06
@lazo77

* {
    border-radius: 1000px;
}

A
AzanuLbizaR, 2017-03-21
@AzanuLbizaR

Should it always be a circle?
border-radius:50%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question