Skip to content

Commit 5bc2416

Browse files
committed
circle inside square
1 parent 6c7354c commit 5bc2416

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
4.43 KB
Loading

css-practice.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# CSS Coding Practice
22

3-
## Q. How to draw a circle inside Square using single DIV in css?
3+
## Q. Draw a circle inside square using single DIV in css?
4+
5+
**Example:**
6+
7+
<p align="center">
8+
<img src="assets/images/circle-inside-square.png" alt="circle inside square" width="250px" />
9+
</p>
10+
11+
<details><summary><b>Answer</b></summary>
412

513
```html
614
<!DOCTYPE html>
@@ -26,7 +34,7 @@
2634
width: 200px;
2735
height: 200px;
2836
border-radius: 50%;
29-
background-color: #eee;
37+
background-color: red;
3038
}
3139
</style>
3240
<body>
@@ -35,7 +43,9 @@
3543
</html>
3644
```
3745

38-
**Live Demo**: [Circle inside Square](https://codepen.io/learning-zone/pen/zYwKbZo)
46+
**&#9885; [Try this example on CodeSandbox](https://codesandbox.io/s/css-circle-inside-square-xqfsuj?file=/index.html)**
47+
48+
</details>
3949

4050
<div align="right">
4151
<b><a href="#">↥ back to top</a></b>

0 commit comments

Comments
 (0)