Home > Software design >  how to use the codes of a css document inline in html document
how to use the codes of a css document inline in html document

Time:05-20

I wanted to create a contact-us page with HTML(no CSS document is allowed to use), then I found what I wanted but the code is written in 2 documents, HTML code is written in HTML document and the styles are in the CSS document. I'm looking for a way to use the CSS codes inline in the HTML document. Could you help me, please?

CodePudding user response:

<html>

<head>
  <style>
    p {
      color: green
    }
  </style>
</head>

<body>
  <p>All your custom CSS can go in the head section of the HTML</p>
</body>

</html>

CodePudding user response:

You will want to use a style tag like this: <style> </style> and inside will go the CSS.

It's good practice to keep your CSS in a seperate file to make the code look cleaner

  • Related