O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an HTML list using CSS selectors

In the previous recipe, we learned how to show data that should be unique using a CSS selector and the id attribute of HTML tags. However, there are a lot of times when we need to show collections of data, such as the names of students in a given classroom, the list of items in a shopping cart, or a list of whatever else you can think of.

This is exactly what we will learn how to do in this recipe.

Getting ready

You can use the code from the examples we used in the previous recipe or you can start a new project.

How to do it...

A HTML list can be created by following these steps:

  1. Add the following section in the index.html file:
    <div data-lift="Animals.list"> <ul> <li><span class="name"></span> - <span class="sname"></span></li> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required