Report this

What is the reason for this report?

About <div> tag

Posted on March 19, 2021

Connected Tutorial(This question is a follow-up to this tutorial):

How To Style the HTML <div> element with CSS

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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

This comment has been deleted

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

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.