Welcome Guest, Kindly Login or Register.

STATS: Total members 31, Total topics 156



How can I make something to be placed at the center with Css?

(264 Views)

Forum rules
This sub-section is only for topics which have been promoted to the frontpage. Please visit the main Websites and Webmasters section to create a topic and see every other topic including recent.(You can still reply to topics here).


Post Reply Go Down
Pinklady
Newbie
Posts: 8
Joined: Sat May 02, 2020 1:02 am
Female Female

How can I make something to be placed at the center with Css?

Post by Pinklady »

I placed a text into a Div block but the issue is that it displays on the left. How can I move it to the center? :roll:
I know it has something to do with css, but im basic at it.



User avatar
Innovin
Administrator
Posts: 35
Joined: Sun Apr 26, 2020 3:53 pm
Male Male

Re: How can I make something to be placed at the center with Css?

Post by Innovin »

Hi @pinklady
You could do this

Code: Select all

<div align="center"> Your Text</div>
There's really no need for any css styling unless you assign a class to the Div block such as

Code: Select all

<div class="pinklady">Your Text</div>
.
Then you could do a css edit as this

Code: Select all

.pinklady {
text-align: center;
}
That should also work

Pinklady
Newbie
Posts: 8
Joined: Sat May 02, 2020 1:02 am
Female Female

Re: How can I make something to be placed at the center with Css?

Post by Pinklady »

Thanks, let me try it out

User avatar
Innovin
Administrator
Posts: 35
Joined: Sun Apr 26, 2020 3:53 pm
Male Male

Re: How can I make something to be placed at the center with Css?

Post by Innovin »

Did that do the trick?

Pinklady
Newbie
Posts: 8
Joined: Sat May 02, 2020 1:02 am
Female Female

Re: How can I make something to be placed at the center with Css?

Post by Pinklady »

Yeah it did :P

User avatar
Innovin
Administrator
Posts: 35
Joined: Sun Apr 26, 2020 3:53 pm
Male Male

Re: How can I make something to be placed at the center with Css?

Post by Innovin »

Alright. Glad I could help. Feel free to talk about any other issues you face in the future @pinklady
Knowledge is indeed interesting. :ugeek:

Post Reply


  • Similar Topics
    Replies
    Views
    Last post

Return to “Websites & Webmasters - h”

Go Up