Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Styling lists

From: Web Accessibility Principles

Video: Styling lists

>> As we talked about earlier with headings the default appearance of certain HTML elements can deter people from using them correctly. If your not using real list because you need custom image bullets or other unique styles. It doesn't take much CSS to do that formatting and keep your HTML clean and semantic. Let's change the appearance of the list we created in the last movie. If you are using the exercise files then the name of the page is visitors.html and its located in the 04 11 folder inside the chapter four exercise files.

Styling lists

>> As we talked about earlier with headings the default appearance of certain HTML elements can deter people from using them correctly. If your not using real list because you need custom image bullets or other unique styles. It doesn't take much CSS to do that formatting and keep your HTML clean and semantic. Let's change the appearance of the list we created in the last movie. If you are using the exercise files then the name of the page is visitors.html and its located in the 04 11 folder inside the chapter four exercise files.

Let's create a new CSS file by clicking on the new CSS rule button at the bottom of the CSS panel. In the new CSS rule dialog box choose tag as the selector type. In the Tag Select menu click on the arrow and scroll down the list to choose UL, this will make the rule affect all unordered list on the page. Keep this document only selected in the define in option, then click okay.

The CSS rule dialog box appears lets start with some very simple styles for the list. Click on the list category on the left side of the dialog box. Then click on the Type menu. You'll see a number of options for standard bullet types. The default bullet for unordered list and most browsers is disc. Let's choose square, don't make any other changes at this point but just click okay.

In design view scroll down the page, the list is now indicated by small square bullets. We can see in the CSS styles panel that the name of the CSS property that controls the bullet type is called list style type. This is the same property that you would use to change the list marker type on an order list as well, say for instance if you wanted to change from numbers to letters. Now that we know how to make basic changes to our list styles lets look at some more unique things that we can do to style the list.

Click on the UL rule in the all rules listing o the CSS styles panel then click on the pencil icon on the bottom of the panel to edit the style by bringing up the CSS rule definition dialog box again. It opens with the list category by default the same category selected by default, the same category that we were on before. Select the Type menu again but this time choose none. This turns off all bullets on the list. We're going to use a background image instead to create the bullet.

You'll see under the Type menu that there's a field for bullet image, while you can use that field to set an image as a bullet for your list it doesn't allow you any type of precise positioning of that image and relationship to the list text. If we instead use a background image for the bullet on the list we have all the related background properties to control its appearance. Before we add that image though we need to change the default margin and the padding on the list, this makes sure that all browsers are starting off from the same baseline so that we can create the proper spacing and make sure our list text overlap our background bullet image.

So click on the box category and the CSS definition dialog box. Under padding keep the same for all box checked and then enter zero in the top field Dreamweaver fills in a value of zero for the rest of the sides. Under margin uncheck the same for all box, set the top margin to zero, the right to zero as well and the bottom box type 1.2 and for its unit select em's.

This ensures that sufficient space is left between lines of text no matter how big the font size is. Finally for the left value type 20 and leave the unit set to pixels. The amount of space to the left and right of this element does not need to scale proportionally with the text so that is why we are choosing pixels here instead of em's now click okay, you'll see that the list now has no bullets but it still is indented on the left side. The bullet background image needs to be added to each individual list itself.

So we need to create a new rule for the LI element. Click on the new CSS rule icon on the bottom of the CSS styles panel. Choose tag for the selector type then in the Tag menu scroll down and select LI form the list of text, keep this document only selected for the define in option and click okay. In the CSS definition rule dialog box choose the box category.

Under padding uncheck the same for all box and type zero for the top, right and bottom fields. In the left field type 16 and leave pixel set as the unit of measurement, this value creates empty space on the left side of each list item. This is where the background image will be positioned by setting the padding on the left side of the list item to be at least as big as the background image. We're ensuring that it will never overlap that image.

Under margin for all checked and then enter zero in the top field. Now click on the background category of the dialog box, here's where we can finally choose our background image. Click on the browse button, under look in navigate to the exercise files folder on your system. Go to the chapter four folder. Then chose the 04 11 folder inside that double click on the images folder from the list of images shown click on bullet_flower then click okay.

In the repeat field back in the CSS rule definition dialog box chose no repeat as the values. Just make sure the background image does not tile throughout the list item, it only shows once. For the horizontal position enter zero, this means we want to the back ground position to be all the way to the left side of the k=list item, choose percent as the unit of measurement simply because that's the unit of measurement we're going to use for the vertical position box. Click in that box now and enter 50 then choose percent from the unit of measurement field beside of it.

50 percent will keep the bullet vertically centered with the list item text, now click okay. The bullet image that we chose now shows beside each list item. You can use background images on list items in this way anytime you need a custom bullet. In the next chapter we will continue working with list but take the styles up a notch to turn list into navigation bars and menus.

Show transcript

This video is part of

Image for Web Accessibility Principles
Web Accessibility Principles

68 video lessons · 25790 viewers

Zoe Gillenwater
Author

 
Expand all | Collapse all
  1. 2m 0s
    1. Welcome
      1m 3s
    2. Using the exercise files
      57s
  2. 33m 15s
    1. What does accessibility mean?
      5m 51s
    2. How does accessibility help your users?
      3m 30s
    3. Experiencing a website via a screen reader
      5m 46s
    4. How does accessibility help you and your clients?
      3m 9s
    5. Overview of Section 508 standards
      5m 51s
    6. Overview of WCAG standards
      6m 4s
    7. Understanding consistency and semantic markup
      3m 4s
  3. 54m 31s
    1. Understanding screen readers and accessibility tools
      6m 12s
    2. Getting accessible browsers
      5m 41s
    3. Customizing Firefox for accessibility testing
      5m 53s
    4. Using custom accessibility toolbars
      5m 28s
    5. Using Fangs and the Color Contrast Analyzer
      5m 30s
    6. Accessibility tools to bookmark
      5m 53s
    7. Using automated accessibility checking tools
      4m 57s
    8. Setting up the JAWS screen reader on Windows
      6m 42s
    9. Using the VoiceOver screen reader on Mac OS X
      5m 52s
    10. Setting Dreamweaver accessibility preferences
      2m 23s
  4. 26m 12s
    1. Avoiding tables for layout
      3m 30s
    2. Using CSS for layout
      2m 40s
    3. Creating a fixed-width layout
      5m 51s
    4. Creating an elastic layout
      3m 51s
    5. Creating a liquid layout
      3m 4s
    6. Customizing a liquid layout
      7m 16s
  5. 1h 6m
    1. Specifying the language
      3m 43s
    2. Setting page titles
      2m 16s
    3. Setting headings and paragraphs
      9m 55s
    4. Styling headings
      9m 56s
    5. Hiding section headings from sighted users
      6m 41s
    6. Styling text for readability
      6m 41s
    7. Ensuring proper color contrast
      6m 36s
    8. Creating text emphasis
      4m 29s
    9. Indicating quotations
      4m 29s
    10. Creating basic lists
      4m 16s
    11. Styling lists
      7m 15s
  6. 1h 15m
    1. Using lists for navigation
      6m 45s
    2. Creating a horizontal navigation bar
      13m 25s
    3. Creating a vertical navigation bar
      11m 44s
    4. Adding skip navigation links
      12m 0s
    5. Hiding skip navigation links
      6m 17s
    6. Proper link text and title attributes
      6m 11s
    7. Opening new windows
      4m 28s
    8. Accessibility limitations of fly-out menus
      6m 30s
    9. Creating an accessible fly-out menu
      8m 38s
  7. 27m 55s
    1. Proper ALT text for navigation images
      4m 57s
    2. Proper ALT text for decorative images
      5m 19s
    3. Adding ALT text to an existing site
      6m 9s
    4. Adding ALT text to image maps
      5m 58s
    5. Describing complex graphics
      5m 32s
  8. 34m 1s
    1. Using tables for data
      3m 0s
    2. Creating header cells
      4m 5s
    3. Adding table captions and summaries
      9m 9s
    4. Styling tables
      5m 19s
    5. Applying header cells to complex tables
      6m 52s
    6. Adding id and headers attributes
      5m 36s
  9. 42m 7s
    1. Understanding form accessibility issues
      3m 7s
    2. Labeling form fields
      6m 9s
    3. Adding fieldsets and legends
      4m 42s
    4. Moving forms out of tables
      3m 44s
    5. Cleaning up a form's appearance
      4m 53s
    6. Aligning labels and fields using CSS
      9m 39s
    7. Indicating required fields
      6m 15s
    8. Dealing with CAPTCHA
      3m 38s
  10. 7m 29s
    1. The Text-Only technique
      3m 21s
    2. The Access Keys technique
      2m 35s
    3. The Tab Index technique
      1m 33s
  11. 18s
    1. Goodbye
      18s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Web Accessibility Principles.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.