0

I'm making a website for our Roblox group

I am trying to center this text (and the button below), but it looks off... Image

It "centers" but it just looks not, I tried searching everywhere but nothing helps

The text code:

<div style="font-family: 'Algerian'; color: #000000; font-size: 1150%; position: absolute; left: 50%; top: 10%">EUROPA</div>
nin
  • 29
  • 1
  • 4

3 Answers3

2

add transform:translate(-50%,-50%); to you code

Junaid Shaikh
  • 1,045
  • 4
  • 19
-1

Add transform: translateX(-50%);. This should center EUROPA horizontally.

Vivek Kumar
  • 113
  • 2
  • 4
  • **This answer is extremely similar to the one provided by [Junaid Shaikh](https://stackoverflow.com/users/17033432/junaid-shaikh), posted 6 minutes before your answer.** – Viraj Shah Jun 03 '22 at 05:18
  • @Junaid Shaikh's solution would _center_ the `div` both vertically and horizontally(not something what @nin wants), hence I provided a way to _center_ the `div` only horizontally. Secondly, I don't have the privilege of commenting, otherwise I would have corrected him in the comments. – Vivek Kumar Jun 03 '22 at 07:23
-1

Try to do every styling in css externally if u want the button at the middle of the page try justify-content: center and align-item:center i am not that good in css but try both ig

  • **Tip #1: _To improve your answer, consider using code blocks or inline code tags_.** – Viraj Shah Jun 03 '22 at 05:21
  • **Tip #2: _Use correct capitalization, punctuation, and sentence structure. Doing so will make your answer easier to read and comprehend_.** – Viraj Shah Jun 03 '22 at 05:22