Hello, What is the difference (CSS) between body and .body in CSS? Also this code worked for me ul, ol { margin-left:1.8em; padding-left:0px; } but I don't know how to interpret it. What is the difference between padding-left and margin-left? I thought those are the same thing. Also, why would we display padding in px, but margin in em? How do I specify that I want this appearance for the ul and ol items only within the body of the page (not a footer or nav. bar)? thank you!!
body is the name of an element. .body is a class name that can be assigned to an element. Margins, padding and the box model.
a "px" is a static value where as an "em" is a dynamic value. (dynamic meaning it can change depending on other values) to answer your other question, you would take the parent element and put it infront of the ul/ol example html would look like : <body> <div id="main_content"> <ul> <li>Example 1</li> <li>Example 2</li> <ul> </div> <div id="footer"> footer content here </div> </body> Code (markup): and your css would look like: #main_content ul { margin: 0px; padding: 0px; } Code (markup): This however would make ALL unordered lists in the container #main_paragraph have those attributes Hope this helps!