Not sure why body is center [duplicate]

94
January 28, 2022, at 3:10 PM
This question already has answers here:
How to horizontally center an element (124 answers)
Closed yesterday.

Any help or hint would be greatly appreciated it.

https://codepen.io/jadeite1000/pen/YzrmJRg

Not sure why my page is center. I don't want it to be center. I just want it to be left align.

                <body>
                <!--
                <h1>The Basic Language of the Web: HTML</h1>
                <h2>The Basic Language of the Web: HTML</h2>
                <h3>The Basic Language of the Web: HTML</h3>
                <h4>The Basic Language of the Web: HTML</h4>
                <h5>The Basic Language of the Web: HTML</h5>
                <h6>The Basic Language of the Web: HTML</h6>
                -->
                <div class="container">
                  <header class="main-header">
                <h1>	
Answer 1

It's center-aligned because of container class

auto: The browser selects a suitable margin to use. For example, in certain cases, this value can be used to center an element.

check this: https://developer.mozilla.org/en-US/docs/Web/CSS/margin#values

.container {
  width: 800px;
  /* margin: 0 auto; */  // remove margin auto
}
Answer 2

In container ruleset you have added margin: 0 auto; which means margin-top:0, margin-bottom:0, margin-left:auto, margin-right:auto.

due to this margin, the ui came to the center.

Try removing margin: 0 auto; in container ruleset.

READ ALSO
php DOMdocument how to select multiple tag elements?

php DOMdocument how to select multiple tag elements?

I have the following code below

90
Compile node module with node-gyp for a specific NODE_MODULE_VERSION

Compile node module with node-gyp for a specific NODE_MODULE_VERSION

I am trying to use an npm package fsuipc in an electron appHowever, when I start the app I get the following error

130
Replacement of com.android.build.api.transform.Transform classes

Replacement of com.android.build.api.transform.Transform classes

I could see in the android document that Transform classes are deprecated but I could not see the new API which we should use instead of Transform classes

119
How to select an entry from a MySQL database by searching for a case-sensitive username

How to select an entry from a MySQL database by searching for a case-sensitive username

I have set up a MySQL database and created a login table using MySQL WorkbenchI am using a MySQL 8

97