Hello Miss,
I used this method and i added <h1> and <p> tag between <div></div>
then did style it in css like clor,padding,margin etc.but result was error.
Miss,then i checked again my coding but coding was true.can you guide me.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
3 answers

Hi @ammara660,

Can you please provide us with the mentioned h1 and p tags also the div ones?

Additionally, what error are you seeing? Is it when loading the website? The best way would be for us to see the css options you’ve created.

Regards,
KFSys

  • <!DOCTYPE html>
    <html>
    <title>Page Style</title>
    <meta name=“viewport” content=“width=device-width, initial-scale=1”>
    
    <head>
    <style>
    h1,
    p {
    text-align: center;
    color: red;
    }
    
        .myDiv {
            padding: 10px;
            margin: 7px;
            height: 400px;
            color: darkblue;
            background-color: rgb(87, 184, 147);
        }
    </style>
    </head>
    
    <body>
    <h1>This is Style</h1>
    <p>Let’s see i will do style.</p>
    <div class=“myDiv”>
    <h1>This is about Blog.</h1><br><br>
    <p>There are many reasons to start a blog for personal use and only a handful of strong ones for business blogging. Blogging for business, projects, or anything else that might bring you money has a very straightforward purpose � to rank your website
    higher in Google SERPs, a.k.a. increase your visibility. As a business, you rely on consumers to keep buying your products and services. As a new business, you rely on blogging to help you get to potential consumers and grab their attention.
    Without blogging, your website would remain invisible, whereas running a blog makes you searchable and competitive. So, the main purpose of a blog is to connect you to the relevant audience. Another one is to boost your traffic and send quality
    leads to your website.</p>
    </div>
    
    </body>
    
    </html>
    

    See,i did just as a practice . you can see,i did 2 style in css as a seprate.but result is not clear.
    Or may be my PC is not supporting coding method due to lack of memory.

    edited by KFSys

Hi @ammara660,

Giving a first look at what you provided as an example everything seems to be correct and should be working properly.

This lead me to test it out on my own as well and in fact it wasn’t working as you mentioned it. After a bit of debugging I found your issue:

<div class=“myDiv”>

See the quotes, they are “ but should be “. That’s the problem, your element is not picking up your class due to the different quotes used.

Regards,
KFSys