Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Structure the Image Gallery

When adding imagery to our site why do we use the <ul> tag specifically?Why not use another tag instead to add imagery?

Why not add a tag like the paragraph tag. What exactly does using the unordered list and list item tags do when it comes to imagery? Also why do we use them for the navigation bar instead of using paragraph tags?

3 Answers

Hey Kavi,

Welcome to coding at Treehouse!

To expand a little on what Jacob and Christopher said above, the ul tag creates an unordered list. By default this will simply allow you to create elements called list items in a bulleted list with li tags. While you could easily use other tags in most cases, the ul is an easy way to tell the browser that you have several elements that all have common attributes and these elements should be rendered in similar ways.

This becomes more of an issue when you would like to add style classes to your html elements with CSS. All list items will inherit attributes from their ul because the ul is what is called a parent element. By comparison, you would have to call every CSS class you wanted to apply on every p tag if you were to use them instead.

You will learn much more about the different html elements and the way they interact with CSS here at Treehouse. As you do, it will become easier to know which tags are most effective in each circumstance.

Hope this helps!

Wow thanks so much for your speedy replies. Really detailed and easy to understand answers! Thanks.

Jacobus Hindson
Jacobus Hindson
14,429 Points

Hi Kavi,

The <ul> tag is for Unordered List this can be used for a range of things like lists, navigation etc. TO add images you generally use the <img> tag.

christopher walsh
christopher walsh
10,763 Points

html has semantic meaning the is read by web browsers and search engines. It also helps you and other people who read your code understand what they're reading. the tags are describing the structure of the web page. html tags are universal and if you mix them up, they won't make sense to web browser, search engines, screen readers and you'll get really confused when its time to add css to your site!