Skip to content
← Back to Community
Flexbox doesn't work on repl?
Profile icon
Typh-Volk

Hi, I've been working on a website trying to see if I can align elements in the horizontal centre of the page, I can't do it on repl, but it works on VSC and some other IDE's. Why's this?

I only did the flexbox to the twitter

Voters
Profile icon
shotofxx
Profile icon
Typh-Volk
Comments
hotnewtop
Profile icon
Coder100

Ok try something like this:

<div style="display: flex; justify-content: center;"> <div>twitter</div> <div>add more styling...</div> </div>
Profile icon
Typh-Volk

Ok will do @Coder100

Profile icon
Coder100

Did it work? @Eyseedoubleyou

Profile icon
Typh-Volk

I haven’t tried yet when I have I’ll tell you. @Coder100 it might work

Profile icon
Typh-Volk

Yes it works but they don’t go on new lines, I believe I just have to use
@Coder100

Profile icon
RYANTADIPARTHI

Use a body tag. It will work

Profile icon
Typh-Volk

Wdym? I believe I already added that @RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@Eyseedoubleyou meaning like, put all your stuff in a body, and use a div for the flex.

Profile icon
Typh-Volk
Profile icon
RYANTADIPARTHI

@Eyseedoubleyou np. Can you please mark my answer? Thanks!

Profile icon
Typh-Volk

@RYANTADIPARTHI as in the tick button?

Profile icon
RYANTADIPARTHI
Profile icon
[deleted]

Hi r u the brother of suhas? @RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@MemeDriod uhh, yes..

Profile icon
[deleted]

Oh come on I had a bet going on @RYANTADIPARTHI

Profile icon
[deleted]

Seriously dude I could have won if ya could of said [email protected]

Profile icon
RYANTADIPARTHI

@MemeDriod oh. With who?

Profile icon
RYANTADIPARTHI

@MemeDriod oh. Sorry...

Profile icon
[deleted]

With a friend [email protected]

Profile icon
RYANTADIPARTHI

@MemeDriod nothing

Profile icon
[deleted]
Profile icon
Typh-Volk

Ok I will do when I fix the problem @RYANTADIPARTHI

Profile icon
RYANTADIPARTHI
Profile icon
Coder100

Well first you should probably move all your HTML components inside the body tag... just saying

Profile icon
Typh-Volk

I believe I already added that if you mean @Coder100

Profile icon
Coder100

The footer is outside of the body tag @Eyseedoubleyou

Profile icon
Typh-Volk
Profile icon
Coder100

Coolio anyways did my solution work? @Eyseedoubleyou

Profile icon
Typh-Volk

I haven’t tried yet @Coder100 I am on my phone at the moment I can’t easily use repl at the moment

Profile icon
xxpertHacker

Repl.it does not interfere in the execution of HTML Repls, they are merely hosted on Repl's static HTTP server, the site is displayed and whatever else in your browser, meaning the same code that worked on VSC will work on Repl.

The problem is just your code, not Repl.

You can accept this as the answer to your question :).

(or you can reword the question itself)

Also, the red that was used on the website actually hurt my eyes, I recommend changing the color scheme, lol.

Profile icon
Typh-Volk

@xxpertHacker the issue was resolved but thanks anyways. In terms of the red, it’s the standard red colour #FF0000, eventually I will change the colour scheme to a more ambient one to look better.