Home > Enterprise >  I tried all the solution I came across HTML 5 for styling
I tried all the solution I came across HTML 5 for styling

Time:11-05

I am stuck in the styling component in HTML 5 and the code is as below.

The question is to put style for property:value since it is just the beginning, but I have tried and tried hitting an impasse.

This exercise is from studytonight.com



<!doctype html>
<html>
    <head>
        <title>My Webpage Title</title>
    </head>
    <body>
    <style 
    <p><style="property:value"> 
    </style> 
    </p>
    </body>
</html>



CodePudding user response:

Yes, the problem is that you are not quite using CSS styles correctly. Almost correct though. Where you have property and value an actual property such as font-size or box-shadow and an actual value such as 20px on the font size or 1px 1px black on the box shadow.

So your CSS might read....

CSS (put this in the HEAD of your page).

<style>
p.molomo {
font-size: 20px;
font-weight: 500;
font-style: italic;
}
</style>

HTML

<p class="molomo">Your text here will style according to the CSS above</p>

CodePudding user response:

<!doctype html>
<html>
    <head>
        <title>My Webpage Title</title>
    </head>
    <body> 
    <p style="color:red; font-size: 24px;">Hello World</p>
    </body>
</html>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe> You can also use inline style like this, also you cannot use Html tags inside style tags.

CodePudding user response:

<!DOCTYPE html>
<html>
  <head>
    <title>My Webpage Title</title>
  </head>
  <style>
    p {
      color: red;
    }
  </style>
  <body>
    <p>name</p>
  </body>
</html>
  •  Tags:  
  • html
  • Related