HTML rules/ CSS rules

when we are typing an html why do we add for example

<p class="description">.......</p>

are we adding this class so we can play around with it in css or whats main reason to create this class? why cant we just simply do the

<p></p>

I think you had some formatting issues, all I see is ....... in your examples :frowning:

i’m not sure how to fix that?

where you trying to copy and paste code? Try to paste it first in notepad or somewhere else to make sure you are copying the text correctly. Or perhaps you have a link to it?

To edit your post here, click the pencil button
Annotation 2020-05-23 071955

im trying to show some code and ask as to why we do it as such but when i type my code its not showing

Hello @ehsanity. To show post, please click this button:


And then put the code in between the back ticks:
Screen Shot 2020-05-02 at 14.06.13
(You don’t need to edit your first post, it would be fine to just create a new post)

oh thank you it worked.

The reason we add classes is exactly that-so we can style groups of things using CCS. They are also useful when working with JS.

2 Likes