Jump to content

html Help pls

Zuccers
Go to solution Solved by duncannah,
2 minutes ago, Zuccers said:

the text goes of center

Remove <center> and add

justify-content: center;

into .main

 

or remove

display: inline-flex;

from .main and keep <center>

Hello, i'm new to coding and i'm trying to make a web design, but i ran into a problem, whenever i make a ".main{}" design, my text gets separated from it into a white box
src code:

<html>

<head>

<body>
<center><i><b>He<sub>ll</sub><sup>o</sup></b><i></center>
<div class="main"></div>

<style>

.main{
background-image: linear-gradient(to right top, #005fff, #009bff, #00c6ff, #00e6cf, #00ff83);
width: 100%;
height: 100%;
display: inline-flex;
}

</style>

</body>

</head>

</html>

 

Thanks in advance :) And please, don't judge my sh!t coding :D 

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, duncannah said:

Your text isn't in the .main element... or I got your question wrong??

Yes, how do i go with fixing it?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Zuccers said:

Yes, how do i go with fixing it?

And if i put it like this: <div class="main"><center><i><b>He<sub>ll</sub><sup>o</sup></b></i></center></div>, the text goes of center

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Zuccers said:

the text goes of center

Remove <center> and add

justify-content: center;

into .main

 

or remove

display: inline-flex;

from .main and keep <center>

🙂

Link to comment
Share on other sites

Link to post
Share on other sites

the center tag is deprecated in HTML5, use text-align: center in your css instead

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×