border-radius: 50%
and transform: rotate(-10deg)
are what you’re looking for.
div {
height: 200px;
width: 400px;
border-radius: 50%;
transform: rotate(-10deg);
border: 1px solid;
background: #e1ecf4;
}
<div></div>
border-radius: 50%
and transform: rotate(-10deg)
are what you’re looking for.
div {
height: 200px;
width: 400px;
border-radius: 50%;
transform: rotate(-10deg);
border: 1px solid;
background: #e1ecf4;
}
<div></div>
You can do this with clip-path, but you will likely need to use a custom path
rather than a simple shape since these are drawn off axis. Alternately, you may be able to get away with doing a clip-path: ellipse(…)
and then transform: rotate(…)
on the div
, then another transform: rotate(…)
with the opposite value on the contents to keep them aligned horizontally.
The steps are the following:
#example {
width: 32px;
height: 32px;
background-color: red;
}
#example {
width: 32px;
height: 32px;
background: red;
border-radius: 16px;
}
transform:
css-property we stretch it in a single direction. transform: scaleX(...)
can stretch a div horizontally.#example {
width: 32px;
height: 32px;
background-color: red;
border-radius: 16px;
transform: scaleX(3.14);
}
And done.
To get a rotated ellipse, you need 2 divs, or a matrix-based css-transform, to combine rotation and stretching.
@j08691 Why did you vote to close this?
@G-Cyr Why did you vote to close this?
@coreyward because it’s a
@TemaniAfif Oy, you say that about everything. It’s a perfectly valid question, especially because this is a relatively obscure area of HTML/CSS. And the question was closed as lacking focus, which is not at all the case here.
@TemaniAfif It’s true of most questions that you could find the answer by searching Google. This is true of many of your own questions. Take it from someone who has been here for 8 years longer than you: this comes up all the time. Thankfully, it is