The style sheet is not reflecting

I have created this small file with HTML and style within the HTML sheet . The styles are not reflecting If i do it inline it is working.

    <!DOCTYPE html>
<html>
    <head>
             
              <style>
{
  p{color:red; background-color:blue;}

   .textbox{background-color:green;

            border-color: red;
            border-width: 15px;
            border-style: solid; }
}

</style>



<script src="C://Users//Karuna//Desktop//getValue.js"></script>
             
        <body>
         <p style="color:red;">New Text here</p>
         <div ><input type="text" id="Mine" class="textbox"></div>
         <div><button type=button id="btn">Hi There</button></div>       
        </body>
    </head>
</html>

Your browser information:

Google Chrome

Version 89.0.4389.114 (Official Build) (64-bit)

Welcome,

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Your head element should not contain your body/main HTML.

Hope this helps

You have an unexpected character below your style tag and like @Sky020 said your head element should not contain your body (or) main HTML.

You do not need that set of curly braces around your css in the styles element.

You also should not be wrapping everything in head which is reserved for metadata.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.