Make a Website (Boundaries and Space)


#1

Good day guys , i have an enquiry regarding Exercise 7 of Make a Website (Boundaries and Space).
I would appreciate your help alot.

Here is the link : https://www.codecademy.com/courses/make-a-website/lessons/boundaries-space/exercises/keep-inline?action=resume_content_item

Instructions
On the Tundra Gallery homepage, notice the navigation bar (navbar) on the bottom left.

In index.html, this is represented by a nav element containing a ul with three list items. Read through the HTML and locate this code.

In main.css locate the nav li selector. Give it a display property of inline.

Click Run and notice the change in the web browser. List items, which are normally displayed as block-level elements, display inline within the navigation.
image

Question: Why was the inline property applied to nav li selector, and not the ul li selector?


#2

if you do ul li as selector, then all unordered list on page become inline. This maybe undesired.

Plus, using nav in your selector, you know this selector applies to the nav section of your page. This is very handy when your website grows in size. if you just did ul li, you have no idea later on which list this applies to


#3

Thank you for your enlightenment


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.