Connected Tutorial(This question is a follow-up to this tutorial):
How To Style the HTML <div> element with CSSHello 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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.