Difference between relative and absolute paths in css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difference between relative and absolute paths in css

I am a beginner in CSS.And I working with "div id's".I am so confused about this topic.can anyone explain clearly about these "div id" and "class" topics and also Difference between relative and absolute paths in css.

16th Mar 2017, 7:07 AM
Charan Kumar Reddy
Charan Kumar Reddy - avatar
3 Answers
0
id must be unique for each element. with class you can groups elements to set them same style
16th Mar 2017, 7:20 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
can you explain them with examples
16th Mar 2017, 7:26 AM
Charan Kumar Reddy
Charan Kumar Reddy - avatar
0
.red{ background-color: #f00; } .text-green{ color:#0f0; } .text-white{ color:#fff; } <!--. HTML. --> <div class="red text-white"> this text must be white <p class="text-green"> Some text. And its green </p> </div> <ul> <li class="text-green"> im green </li> <li class="red"> red bg </li> </ul>
16th Mar 2017, 7:42 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar