I want a this code in center can anyone help me ???? | Sololearn: Learn to code for FREE!

+3

I want a this code in center can anyone help me ????

https://code.sololearn.com/Wc6bnZBNRl8K/?ref=app

5/24/2022 11:20:15 AM

Alpesh Solanki

26 Answers

New Answer

+9

HTML Give your main div a class. It can be any name you want but I choose center. <div class="center"> In your CSS tab or in your <style> element add this: .center{ margin:auto; } https://code.sololearn.com/WsxlOq6Td9Qx/?ref=app

+7

Thank you so much Chris Coder

+5

What exactly do you want to center? The div? Try to set div's margin to auto in order to center horizontally.

+5

Read my reply carefully: WHAT EXACTLY DO YOU WANT TO CENTER?

+4

The text already is centered horizontally. Do you want to center the text vertically? Or do you want to center the divs vertically or horizontally on the page? Please be precise.

+2

Not working

+2

Try <h1 align="center">example<h1>

+2

Totally working broπŸ™‚ https://code.sololearn.com/W4IidIS5K7E6/?ref=app

+1

Can you do this for me

+1

Yess I want to do center

+1

WHAT do you want to center? WHICH ELEMENT?

+1

The text of code

+1

1 2 HOME Kind. kinder

+1

This tutorial will teach you CSS https://www.sololearn.com/learning/1023

+1

Vertical center i want

+1

position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);

+1

please which app are you guy using to view your code

+1

Hello brother thank you for your answer I can try if so how thank you in advance

0

body { text-align: center; } div { /*width: 300px; height: 300px;*/ background-color: aquamarine; }

0

my ESfile explorer is not more working