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

Wrapping tags

From: Dreamweaver CS6 Essential Training

Video: Wrapping tags

Occasionally when writing code you'll need to take existing content, and wrap it inside of another parent tag. Well, this is usually fairly simple. It's sometimes rather difficult to do manually and still keep track of exactly where the proper position for opening and closing tags needs to be. Let's take a look at how Dreamweaver can help us out when we need to wrap content in our tags. So I've the Index file open this time from the 05_04 folder, and the first thing I'm going to do is scroll down to about line number 51. Down in this area we have an unordered list that has a calendar of events.

Wrapping tags

Occasionally when writing code you'll need to take existing content, and wrap it inside of another parent tag. Well, this is usually fairly simple. It's sometimes rather difficult to do manually and still keep track of exactly where the proper position for opening and closing tags needs to be. Let's take a look at how Dreamweaver can help us out when we need to wrap content in our tags. So I've the Index file open this time from the 05_04 folder, and the first thing I'm going to do is scroll down to about line number 51. Down in this area we have an unordered list that has a calendar of events.

Now you'll notice that the structure of the final list item is little different than these, in the fact that it lacks the span tag that identifies those numbers as belonging to the date class, so that's what we need to add. Well, we could go ahead and do it the hard way, which would be to go ahead and put the opening span tag on this side, and then go back over on the side of the day and close it, but again, that's going to take a little bit longer. I'd rather just wrap in the tag and have Dreamweaver do it for me. So what I'm going to do is just highlight just the date number itself, 5/21 and then going over the Coding Toolbar, I see what looks to be a pencil on a tag and that is exactly the icon.

That's called Wrap Tag. It's actually the Tag Editor icon, but when you have code highlighted like this, any content highlighted it changes its functionality, when I hover over it, it's going to say Wrap Tag. As soon as I click on that I get a little tool tip that comes up, this is okay. What do you want to wrap this in? Well, I want to wrap it in a span tag like everybody else, but I also want an attribute applied to that, and that's the class attribute. So I'm going to hit space and you'll notice that all of my code hinting comes right along with me right here in this tool tip. So this is awesome. I can just go ahead and do class. I can type in date, but I don't even need to type in date, Dreamweaver does it for me.

Now how does it know? Well, what it's doing is, it's going out to my styles, and it's finding all the IDs and all of the classes that are defined within my external stylesheet. It's going to make those available to me, whenever I do an ID attribute or a class attribute. So then I can just pick them out from a list. Now if I'm typing my code from scratch, and I don't have any styles applied, then each time I'm going to need to go ahead and type that in. So this is a really good reason where you should go in and just sort of define some classes that you know you're going to need within your CSS file, because this is going to give you quick and easy access when applying those classes within your code.

All right to finish this up, all I've to do is hit Return to choose date, and hit Return one more time. You'll notice that the opening and closing tag are taken care of for me. It's going to wrap that content in the tag, very simple, very easy. Now that is simple, but it gets a little bit more difficult when your content becomes more complex. Let me show you what I mean. If I scroll down towards the bottom of the page, down towards the footer, I'm going to go down to about line 91 or so. I think I went a little too far, yeah I did. You can see that the footer basically has several sections of links inside of it, and within those individual sections, there are individual columns, so that links can sort of sit right side by side each other, and the way that that is structured, each of the columns is inside of a div tag.

So I've separate unordered list that are grouping these links together, and then they're incased within a div tag which is then further incased inside this section. Okay, so sometimes you can sort of forget some of that content, and in this case, we don't have the div tag for column 1, so I need to surround this unordered list. Well, that can sometimes be very difficult to do. I can't tell you how many times I've seen people do this, watch this. Did you see what I did wrong? Notice I've the very end of the closing angle bracket (>) there, left unselected. So now if I was to wrap this, or modify this code in anyway, I'd basically be messing my code up.

So I'm going to use the Coding Toolbar to help me out here. I'm going to click inside any one of these links, then I'm going to use this little icon right here which is the Select Parent Tag icon. I can click on that once and twice, and as soon as I click on it twice, I get to the unordered list and it wraps all the way around that. Now I could go right over here again to the coding toolbar, that was pretty easy and click the Wrap Tag icon. But there is a second way for you to quickly and easily wrap tags and that is the exact same method that we used earlier in the title, when we were talking about using the Quick Tag Editor in Design view.

The Quick Tag Editor works here in Code view as well, which makes it even more of an amazing tool. So if I do my keyboard shortcut, which if you remember it, it's Ctrl+ or Cmd+T based upon your platform. So I'm just going to of Ctrl+T. As soon as I do that, notice that the tool tip comes up for the Quick Tag Editor. Now I can say div class="col1". Hit Return twice. It's going to finish that for me and wrap that and now if I save this and preview this in my browser, I can see that my column1 is showing up properly.

I can also see in my account of events, last one is styled properly and is being represented as a date as well. So there we go, taking advantage of Dreamweavers' ability to wrap content in a tag with a single shortcut. Not only is it going to speed up your coding, but it's also going to help you reduce errors, by making sure that the opening and closing tags are in exactly the right location.

Show transcript

This video is part of

Image for Dreamweaver CS6 Essential Training
Dreamweaver CS6 Essential Training

90 video lessons · 56524 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 1m 4s
    1. What is Dreamweaver?
      1m 4s
  2. 5m 44s
    1. Welcome
      1m 4s
    2. Using the exercise files
      2m 17s
    3. Learning web design
      2m 23s
  3. 1h 0m
    1. Looking at the Welcome screen
      5m 9s
    2. Exploring Windows and Mac interface differences
      5m 6s
    3. Arranging panels
      8m 44s
    4. Managing workspaces
      10m 14s
    5. Exploring the Application toolbar
      6m 21s
    6. Exploring the Document toolbar
      8m 47s
    7. Working with the Property inspector
      9m 30s
    8. Using the Insert panel
      6m 30s
  4. 53m 3s
    1. Understanding basic site structure
      3m 46s
    2. Exploring file naming conventions
      2m 10s
    3. Defining a new site
      5m 23s
    4. Managing files and folders
      7m 57s
    5. Adding remote servers
      7m 4s
    6. Uploading files
      12m 46s
    7. Previewing in browsers
      9m 11s
    8. Managing multiple sites
      4m 46s
  5. 36m 41s
    1. Creating new documents
      6m 49s
    2. Setting up new document preferences
      5m 30s
    3. Setting accessibility preferences
      6m 49s
    4. Working with starter pages
      4m 32s
    5. Managing starter pages
      13m 1s
  6. 37m 23s
    1. Getting text into Dreamweaver
      8m 43s
    2. Importing Word documents
      4m 6s
    3. Adding structure to text
      7m 35s
    4. Creating lists
      4m 35s
    5. Creating definition lists
      4m 0s
    6. Using the Quick Tag Editor
      8m 24s
  7. 44m 41s
    1. Exploring the Code toolbar
      5m 41s
    2. Setting code preferences
      7m 19s
    3. Using code hints
      8m 8s
    4. Wrapping tags
      5m 7s
    5. Adding comments
      6m 29s
    6. Using snippets
      7m 32s
    7. Formatting source code
      4m 25s
  8. 1h 19m
    1. Setting CSS preferences
      9m 32s
    2. An overview of the CSS Styles panel
      9m 23s
    3. Creating a new CSS rule
      6m 42s
    4. Using the CSS Rule Definition dialog
      7m 25s
    5. Organizing styles
      7m 22s
    6. Modifying style properties
      6m 17s
    7. Controlling CSS through the Property inspector
      6m 37s
    8. Attaching external style sheets
      5m 54s
    9. Using CSS visual aids
      7m 3s
    10. Using CSS Inspect
      6m 48s
    11. Using the Code Navigator
      6m 39s
  9. 1h 11m
    1. Managing assets in Dreamweaver
      7m 30s
    2. Setting external image editing preferences
      4m 26s
    3. Placing images on the page
      10m 12s
    4. Exploring Photoshop integration
      7m 17s
    5. Modifying Smart Objects
      9m 42s
    6. Modifying image properties
      8m 4s
    7. Styling images with CSS
      6m 45s
    8. Using background graphics
      7m 28s
    9. Positioning background graphics
      10m 10s
  10. 36m 23s
    1. Link basics
      3m 17s
    2. Setting site linking preferences
      2m 19s
    3. Creating links in Dreamweaver
      9m 17s
    4. Using absolute links
      3m 43s
    5. Using named anchors
      6m 41s
    6. Creating an email link
      5m 25s
    7. Creating CSS-based rollovers
      5m 41s
  11. 44m 30s
    1. Reviewing table structure
      5m 20s
    2. Importing tabular data
      6m 46s
    3. Creating accessible tables
      6m 11s
    4. Exploring basic table styling
      9m 42s
    5. Styling alternate rows
      8m 57s
    6. Creating custom table borders
      7m 34s
  12. 59m 15s
    1. Understanding how forms work
      2m 45s
    2. Reviewing form design
      3m 44s
    3. Creating accessible forms
      5m 16s
    4. Setting form properties
      2m 39s
    5. Using the fieldset and legend tags
      2m 52s
    6. Inserting text fields
      6m 56s
    7. Inserting list menu items
      7m 54s
    8. Inserting checkboxes
      4m 14s
    9. Inserting radio button groups
      3m 52s
    10. Inserting submit buttons
      2m 25s
    11. Exploring basic form styling
      8m 2s
    12. Exploring form element styling
      8m 36s
  13. 33m 25s
    1. Adding CSS3 transitions
      8m 29s
    2. Spry overview
      2m 44s
    3. Using Spry widgets
      3m 57s
    4. Adding Spry effects
      8m 1s
    5. Using the Widget Browser
      7m 4s
    6. Extending Dreamweaver
      3m 10s
  14. 1m 2s
    1. Additional resources
      1m 2s

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 Dreamweaver CS6 Essential Training.

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.