+ 2

Hello...if i make a div element in HTML & round the div to a circle with CSS, how do I keep the writing in the middle?

hereEis my code : https://code.sololearn.com/We46sc64W4vk/?ref=app

15th May 2017, 5:25 AM
Delwyn Dunbar Taiwan
Delwyn Dunbar Taiwan - avatar
2 Answers
+ 5
Add a <p> element around the text and inside the other element. <element class="hi"><p>text</p></element> and add this into your CSS file: .hi p { position: relative; transform: translate(0%, -50%); top: 50%; text-align: center; }
15th May 2017, 5:59 AM
The Coding Sloth
The Coding Sloth - avatar
+ 1
thanks a lot.
15th May 2017, 7:46 AM
Delwyn Dunbar Taiwan
Delwyn Dunbar Taiwan - avatar