Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

I am having trouble with <style>

Yompso

New Coder
So I recently started coding with Free code camp, and I have a bit of trouble with using <style>, I am trying to give the text-align property the value of center, but it does not work, can you help me?, here's my code:

HTML:
<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="utf-8" >

    <title>Cafe Menu</title>

    <style>

    h1 {property:text-align value;center}

    </style>

  </head>

  <body>

    <main>

      <h1>CAMPER CAFE</h1>

      <p>Est. 2020</p>

      <section>

        <h2>Coffee</h2>

      </section>

    </main>

  </body>

</html>
 
Last edited:
Please use bb tags to keep formatting.

correct usage

HTML:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1 {
            text-align:center;
        }
    </style>
</head>
<body>
    <h1>CAMPER CAFE</h1>
</body>
</html>
 
Please use bb tags to keep formatting.

correct usage

HTML:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1 {
            text-align:center;
        }
    </style>
</head>
<body>
    <h1>CAMPER CAFE</h1>
</body>
</html>
just fixed it thank you !
 
Well, there are some logical errors with your code, try below code to fix this error.

Code:
<!DOCTYPE html>


<html lang="en">


  <head>


    <meta charset="utf-8" >


    <title>Cafe Menu</title>


    <style>


    h1 {
      text-align: center; /* property: value; */
    }


    </style>


  </head>


  <body>


    <main>


      <h1>CAMPER CAFE</h1>


      <p>Est. 2020</p>


      <section>


        <h2>Coffee</h2>


      </section>


    </main>


  </body>


</html>

Thanks
 
Well, there are some logical errors with your code, try below code to fix this error.

Code:
<!DOCTYPE html>


<html lang="en">


  <head>


    <meta charset="utf-8" >


    <title>Cafe Menu</title>


    <style>


    h1 {
      text-align: center; /* property: value; */
    }


    </style>


  </head>


  <body>


    <main>


      <h1>CAMPER CAFE</h1>


      <p>Est. 2020</p>


      <section>


        <h2>Coffee</h2>


      </section>


    </main>


  </body>


</html>

Thanks
thank you! it worked
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom