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

Applying definition lists

From: Typography with CSS in Dreamweaver

Video: Applying definition lists

Definition Lists are too often ignored for the workhorses they can be and the problem is all in the name. Not every web designer is given the mandate to include a series of definitions in every site they create, but how many times have you had to create an FAQ? Definition Lists are the perfect vehicle for your frequently asked questions. In this video I'll show you how to turn a series of question and answer paragraphs into a stylish FAQ. So I have open here the faq.htm file from the Chapter 8 > 08_03 folder and we're in Design view.

Applying definition lists

Definition Lists are too often ignored for the workhorses they can be and the problem is all in the name. Not every web designer is given the mandate to include a series of definitions in every site they create, but how many times have you had to create an FAQ? Definition Lists are the perfect vehicle for your frequently asked questions. In this video I'll show you how to turn a series of question and answer paragraphs into a stylish FAQ. So I have open here the faq.htm file from the Chapter 8 > 08_03 folder and we're in Design view.

So scroll down to right below a Backpack California, and I'll scroll up just a little bit to explain the structure of this page. Eventually, what will happen here is all of these main categories will include separate FAQs. So I'm just working with the first one here called Backpack Cal and let me scroll back down to where that is. As you can see there is a series of paragraphs, where the first paragraph is a question and the second paragraph is an answer; pretty straightforward in terms of FAQ.

So the first thing we're going to do to turn this into a Definition List is select all the text that is included in these paragraphs. So that will include all of the text down to We appreciate your understanding and now I'm going to add in the necessary tag to identify this as a Definition List. Now you can find this in a number of ways in Dreamweaver. Let's open up the Insert panel and then switch to the Text category and if you scroll down the Text category and go all the way down to the bottom, you'll see three definition related tags.

The first is the one we need, Definition List. This is the overall encompassing container much like Ordered List and Unordered List. So instead of a ul or ol tag, when I click Definition List, it will wrap my paragraphs with a dl tag. Now as you can see what it did was just basically collapse the paragraphs and gave a little bit of styling where it indented alternate paragraphs, but look what happens when we click into the tag.

The first paragraph is wrapped with a definition term or dt tag, whereas the second paragraph has a definition description or dd tag. Now Dreamweaver does this all automatically when you have a series of paragraphs that alternate in a question and answer format. So it makes it very, very easy for you to apply a Definition List to an entire long series. One caveat though, you need to do this in Design view. If you try to do this in Code view it won't work and you'll have to manually make those changes.

So now let's do some styling. We're going to create three different rules; one for each of the Definition List related tags. Let's start with Definition List itself. So I'll select out of the Tag Selector and then go over to the CSS Styles panel and click on New CSS Rule and let's make this a little bit less specific just so we have mainContent, mainArticle dl. Click OK. The first thing we're going to do is adjust the margin and padding. So let's go to the Box category, deselect the Padding and Margin and same for all, and then let's just add in a 1 Em of margin for both the Padding Bottom and the Margin Bottom.

Next, we also want to add a little bit of a border here, so it will separate the Definition List FAQ from the rest of the page. So go to Border and deselect the Same for all under each of the categories, and under Border Bottom Style choose solid, under Width enter in 1 pixel, and then for the Color let's choose medium gray 999, okay. I'll click on that and you won't see a whole lot of change there.

There you can see my border appear. Now let's go to the definition term, which is basically the question in our FAQ. So I'll highlight dt from the Tag Selector, choose New CSS Rule and again make it less specific, so we can use this wherever on our site, click OK. Now we get to modify the actual font. So I'm going to choose a slightly different font than we have in other places on the page. I'll use Tahoma, Geneva, sans-serif.

Let's make the Font-size .9 ems and let's make it bold. It is the question, after all. Finally, let's change the color and we'll go for a darker gray here. Now I want to space it just a little bit so it stands out. So I'll go to Block and under Letter-spacing put in 1, in this case I'm going use pixel. Finally, we need to adjust the Padding and Margin. So we'll go to the Box category for that and under Padding just put in 0, with the Same for all selected so that will be applied all round.

Deselect the Same for all under Margin. So on the Top margin we'll make that 1 em, on the Right it will be 0, Bottom will be 0.5 Em and Left will be 0. Okay, let's see what that results in. So good, as you can see we get a little separation here. It stands out a little bit, because we have a little additional letter spacing and overall it looks pretty good. So, our final one to tackle is the definition description.

I'll put my cursor in the first one and then select dd tag there. One more New CSS Rule and click Less Specific a couple of times. Now click OK. I'm going to make sure that the font size is the same as the question; .9 ems. I'm going to add a little separation here, because our answers tend to be a little bit long. So let's go ahead and make the Line-height 1.4 ems. We'll keep the same color, the darker gray.

Now to make it standout just a bit why don't we go ahead and justify the text, and for that you'll need to go to the Block category and under Text-align choose justify. To the Box category now to handle the Margins and Padding. Margins we'll just zero out. Click the Same for all check box to clear that under padding and all we really want to do is put in a 2 em padding on the left. Alright, let's click OK and there we have our final presentation.

Now let's go into Live view just to verify that it looks as good as we hope it does. There you can see the justified text and the site consistent styling. Definition List can be brought into play whenever you have a collection of name/value pairs, like question and answer or a series of web site links and their associated descriptions.

Show transcript

This video is part of

Image for Typography with CSS in Dreamweaver
Typography with CSS in Dreamweaver

36 video lessons · 8014 viewers

Joseph Lowery
Author

 
Expand all | Collapse all
  1. 3m 52s
    1. Welcome
      1m 19s
    2. Using the exercise files
      2m 33s
  2. 19m 16s
    1. Working with the Property inspector's HTML tab
      2m 0s
    2. Making the most of the Property inspector's CSS tab
      4m 57s
    3. Defining and changing type with the CSS Rule Definition dialog
      6m 16s
    4. Modifying type directly in the CSS Styles panel
      6m 3s
  3. 19m 45s
    1. Understanding type measurement unit options
      2m 50s
    2. Working with pixels
      2m 34s
    3. Defining a percentage-based page with ems
      6m 51s
    4. Letting users set page type size
      7m 30s
  4. 17m 36s
    1. Getting to know the basic font categories
      1m 32s
    2. Employing web-safe fonts
      3m 20s
    3. Defining new font families
      3m 22s
    4. Exploring CSS3 typeface options
      3m 9s
    5. Setting up @font-face
      6m 13s
  5. 9m 39s
    1. Dispelling the myth of web-safe colors
      1m 13s
    2. Applying color to type
      4m 52s
    3. Incorporating semi-transparent type
      3m 34s
  6. 19m 46s
    1. Setting the font-weight
      3m 48s
    2. Mandating font case
      2m 25s
    3. Exploring font variants
      1m 50s
    4. Utilizing white space effectively
      3m 40s
    5. Changing letter and word spacing
      2m 20s
    6. Defining first-line variations
      2m 19s
    7. Inserting drop caps
      3m 24s
  7. 20m 17s
    1. Applying CSS3 text effects
      5m 26s
    2. Designing type gradients
      8m 27s
    3. Rotating text with CSS transform
      6m 24s
  8. 15m 21s
    1. Implementing advanced headings with HTML5
      3m 11s
    2. Preparing CSS3 multiple-column layout
      4m 50s
    3. Future type: Defining CSS Regions
      7m 20s
  9. 24m 51s
    1. Styling unordered lists
      6m 51s
    2. Specifying a sequence with ordered lists
      5m 14s
    3. Applying definition lists
      7m 19s
    4. Targeting list items with CSS3 nth child
      5m 27s
  10. 20s
    1. Next steps
      20s

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 Typography with CSS in Dreamweaver.

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.