I am going to ask a very basic DIV question because I want to get some clarity. If I create two or three DIV sections how do I differentiate one from the other. For example, I want one paragraph to be formatted one way using DIV and another paragraph another way, using another DIV.
The reason for this is because I am just learning about DIV and how to use the property correctly. I had a problem in that I wanted one part of my site to do one thing and another to do something else. However, when I used the DIV property I found everything related to that ONE Div property.
Hope that makes sense
You can use id attribute
The best way to differentiate your DIV’s is by giving them a class or id attribute. For example:
<div class="random"> </div>
This way later in your code when you are trying to get your DIV’s to do different things, you can format your code according to the class or id names.
Thank you - I did wonder if this was something I could do. So I am pleased to know I am thinking in the same way - as a coder! That has given me a lot of confidence.
And thank you too. That has clarified quite a few things. I wasn’t sure how classes worked but I think I am actually sure how they work, just not confident to code them. Now I can see I was thinking in the correct way.
Thanks very much
You are welcome. I’m glad to know that it was helpful for you.
I really love coding and getting advice from people like you is invaluable. Really so helpful!
I’m also a learner like you I’m not so good programmer. I’m also struggling with things like you are and it’s usual.
By the way I’m pleased to help you
No problem, a good tip to keep in mind is you can assign classes and id’s to anything. For example:
Once you get more comfortable with coding this will definitely come in handy.
thank you very much. I have just completed one CSS section. Now I am going to try writing a basic web page !
thank you too. Yes, I think I am getting the hang of things now. I am going to write a basic web page using CSS and DIVs