Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer day - @672.14
Activity rating: Four Stars Posts & Arts: 72/1k.beats Random | Recent Posts | Guild Recents
News: :skull: Websites are like whispers in the night  :skull: Guild Events: There are no events!

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  How to allign


« previous next »
Pages: [1] Print Embed
Author Topic: How to allign  (Read 2772 times)
SilkSkull
Hero Member
*****
View Profile WWW


⛺︎ My Room
iMood: SilkSkull

Artifacts:
First 1000 Members!Cool Dude AwardJoined 2022!High Speed Ozwomp!
« on: an Autumn night » Embed

How do I align my text the the centre of a page? I know that it involves CSS but I can't figure out how to work <stlye> for the life of me, here is my code as of now:

https://ibb.c:ha:7XHkqjf

Logged

She/Her
Figuring out a new sig :P
https://web.archive.org/web/20090821100844im_/http://geocities.com/Athens/9334/water.gif
Memory
Guest

« Reply #1 on: an Autumn night » Embed

If you just want to centre-align the text itself, add style="text-align: center;" to your HTML element that holds the text (<div>, <p>, etc.)

If you want to centre an element horizontally on the page, like a <div>, you can do so by setting a width that's less than 100% of its parent container and then adding style="margin: 0 auto;".

Those are the two easiest solutions to the most common use cases. There are a lot of different ways to position things on the page, but since you're just starting out you probably don't want to get into flex or grid yet.

Logged
SilkSkull
Hero Member
*****
View Profile WWW


⛺︎ My Room
iMood: SilkSkull

Artifacts:
First 1000 Members!Cool Dude AwardJoined 2022!High Speed Ozwomp!
« Reply #2 on: an Autumn night » Embed

If you just want to centre-align the text itself, add style="text-align: center;" to your HTML element that holds the text (<div>, <p>, etc.)

If you want to centre an element horizontally on the page, like a <div>, you can do so by setting a width that's less than 100% of its parent container and then adding style="margin: 0 auto;".

Those are the two easiest solutions to the most common use cases. There are a lot of different ways to position things on the page, but since you're just starting out you probably don't want to get into flex or grid yet.

So I followed what you said and it is still sticking to the left side of the page, did I enter the <style> tag wrong?

My New Code:
https://ibb.c:ha:7XHkqjf

Site:
https://ibb.c:ha:vQSp0Fb

Logged

She/Her
Figuring out a new sig :P
https://web.archive.org/web/20090821100844im_/http://geocities.com/Athens/9334/water.gif
Memory
Guest

« Reply #3 on: an Autumn day » Embed

There is a <center>...</center> tag.
It's obsolete, but it works.
https://www.w3.org/TR/html401/present/graphics.html#edef-CENTER

Logged
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Bug!You're a Star!Flinstone VitaminI got robbed by Dan Q on Melonland!Always working hard!Known Apple shill
« Reply #4 on: an Autumn day » Embed

My New Code:
https://ibb.c:ha:7XHkqjf

I think thats the same code image you posted already :omg:k: (You could also paste the code here in code tags)
Code
like this

Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: Red TulipLurby?here comes the bapSmile on, rainbow flower!Plank
SilkSkull
Hero Member
*****
View Profile WWW


⛺︎ My Room
iMood: SilkSkull

Artifacts:
First 1000 Members!Cool Dude AwardJoined 2022!High Speed Ozwomp!
« Reply #5 on: an Autumn day » Embed

Thank you guys for all the help! Turns out I'm a little dumb lol. Also should it work the same with aligning to the left and right?

Logged

She/Her
Figuring out a new sig :P
https://web.archive.org/web/20090821100844im_/http://geocities.com/Athens/9334/water.gif
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 MelonLand Editor Recent Edits Tenement Arcade Want to Login or Join ? Forum Art Hub Chat Webring Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Frutiger Aero Forum Onio Club m15o's Web Services 32Bit Cafe iMood Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers
Zap!
Minecraft: Online
Join: craft.melonking.net