Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
Discover how to build web sites, prototypes, and more in this course on Adobe Dreamweaver CS6. Author James Williamson shows designers how to take control of their site by properly naming and structuring files and folders; how to create new documents and web pages from scratch or with starter pages; and how to add content such as text, images, tables, and links. James also provides a background on the languages that power projects built in Dreamweaver—HTML and CSS—and introduces the programming features in the application, for developers who want to dig right into the code. The last chapter shows how to finesse your project with interactive content such as CSS3 transitions and Spry widgets.
In this chapter we are going to discuss using Dreamweaver to add text and structure to your HTML. Although you can certainly type to your heart's content inside Dreamweaver, chances are that most of the copy you work with will be created either by you or another person in a program other than Dreamweaver. So we are going to start by discussing how to get text from those programs into Dreamweaver. So I have the programs.htm file open from the 04_01 directory. You'll notice that over here in the main content section I don't have any content.
This is pretty typical. You will create a page, and you style it, and then you'll go out to get the content that someone else has written or that you've written in a word processing program and you'll just paste it in. So it's actually a really common workflow. I notice over here in the Files panel I have an assets directory folder and inside that I have this Word document programs.doc. Now the great thing about Dreamweaver is it recognizes that this is a Word program. In fact, within Dreamweaver's Preferences, you can tell it what type of program to use when editing specific types of files.
The default one for Word is of course naturally Word. So if I double-click this icon, this is going to go ahead and open up this file directly inside of Word. So here we are in Word and I can see that someone's been very helpful to us in terms of formatting the content for me. So they have structured the content, they have applied styles to it. And let's break down kind of the styling that they have applied, the structure that they have added, and we can talk about how that's going to translate once I get back over in the Dreamweaver. So if I click inside the first heading here Academic Programs, I can see that the default style Heading 1 has been used.
If I click inside the paragraph, I can see that the custom style Body Copy has been applied to this. Now I appreciate somebody styling this for me, I'm not really sure I'm all that supportive of their color choices, but it's nice of them to go ahead and format this for you and you are going to find that people will do this a lot for you if they are giving you content. They will create a Word document and they will try their level best to make it look exactly the way they want it to look on the webpage. Actually, they're not helping you at all when they do that. So I want to talk about the things that they can do that will help you and some of the things that they might do that might not be so helpful that you need to look out for.
So again with all of the headings you will notice that we are using default the Heading 1, Heading 2, and Heading 3 styles. That's important because there are preferences within Dreamweaver that are going to help retain that structure and make sure that the proper structural tags in the HTML are used for this content. You will also notice that certain text doesn't have a style applied to it, but we do have formatting such as Bold or Italic applied to it as well. Dreamweaver has options to remember that as well and that can save you a little bit of time when you copy and paste this text.
So what I am going to do now is I am going to go ahead and do a Select All and I am just going to copy this text and then I am going to jump back into Dreamweaver. Alright! So here I am back in Dreamweaver. I am going to place my cursor right inside this main content region. But one of the things you'll probably notice, if you're like me and you're in Design view, is I have this sort of dotted line or dashed line all the way around this area. That's to let me know visually that there is a region an element here that is acontaining element that I can put content inside of. In fact, if you click inside this and you look down here in the tag selector, you'll see that I'm now inside of a paragraph tag which is inside this article element with an ID if mainContent.
So again that's just another way to sort of double-check and make sure you're in the right place. Now before we paste our text, I want to bring up the Preferences inside Dreamweaver that guide this process and show you what the results of those different preferences will be. So, if I go up to Edit and choose Preferences, on the Mac you'd go to Dreamweaver and choose Preferences, I am going to go right here to the Copy/Paste category. So we have a few options here. The first option is Text only, then we have Text with structure. You will notice it's talking about basic structural elements like paragraphs, list, tables, and things like that.
Then we have Text with structure plus basic formatting, which is bold and italic. Now this is the default preference actually. So if you haven't set this before, that's the one that you are likely to see selected and then finally we have Text with structure plus full formatting and that's bold, italic plus styles. We have another set of options below this and we have some checkboxes down here. I want to talk about what these will do for you. The first one is Retain line breaks. So if somebody in Word has done what's known as a soft return. So instead of hitting Enter or Return, they hit Shift+Enter or Shift+Return to break down to another line, but stay within the same paragraph, Dreamweaver will honor that for you and it will put a line break tag, a br tag in the code rather than a paragraph.
Then we also have this really nice little feature that cleans up Word paragraph spacing. It's very common for people in Word to get space between their paragraphs by hitting Return or Enter twice rather than going up and formatting that space. So what Dreamweaver will do for you is it will rip out all those empty paragraphs so you don't end up with code that's just littered with empty paragraphs. Then finally we have the Convert smart quotes to straight quotes. So if for example someone did smart quotes and they have these curly quotes and you need straight quotes for measurements or something like that, you can rip those out as well.
So what I am going to do is I am just going to go up and experiment with these different preferences that we have. I am going to start with Text only. So if I click OK and I paste my content in now, Text only is exactly what I get. I don't get any line breaks, I don't get anything other than just one huge paragraph with all of that text. That has the advantage of stripping out any formatting from Word that we don't need. You will notice a lot of times when you paste text in from Word that it brings in some pretty funky formatting; line breaks that you didn't mean to bring in, paragraphs that are all over the place, and this is one way to sort of just strip all that stuff out and allow you to go back in and apply your own structure to it.
Of course, this particular workflow is going to be a little bit more manually labor-intensive, because now I would have to go in, manually insert all my paragraphs and headings and things like that. So I am going to undo that. I am going to back to my Preferences. This time I am going to go to the other extreme and I am going to do Text with structure plus full formatting. Now for a lot of new Dreamweaver users this seems like Mecca. They are like, wait a minute. I can bring in the text from Word and retain all of the formatting? That means I can work in Word the way I like to and bring it in and poof! My webpage magically looks just like that.
Well, there are some problems with this particular workflow. Let's check those out. If I click OK and then paste my text again, notice that it does come in and it does sort of retain the formatting. This particular file has an external CSS file that's driving the look and the feel and the presentation, if you will, of the text. So what we are seeing here is we are seeing some conflicting styles. It's retaining some of the formatting from Word and it's getting a lot of its formatting from the external CSS file. To really understand what's going on here, we are going to need to switch over to the Code. So I am going to switch over to Code view and I can see that these paragraphs that it brought in also have these classes applied to them like BodyCopy and MsoNormal.
Now if you remember from the Word document, BodyCopy was one of the styles that we had up there. So it actually brought that style in, but it brought that style in as a class. It also places the style in the head of the document as an embedded style and you can see it sort of writes a custom selector around this. I doubt that this is a workflow that you really want to embrace, because if you're controlling your entire site with your external CSS file, you are going to have a lot of styling conflicts, you are going to have more classes applied to your files than you need and it's just not a very efficient way of working. So once again I am going to go back to Design view and I'm going to undo that.
I'm going to go up and do one final preference and this time I am going to do Text with structure plus basic formatting. Now this one is almost exactly like the option above it, the only difference is if anybody has applied bold text or italic text inside of Word, it's going to honor that in Dreamweaver and I want to show you how it honors that. So I am going to bring this back in, I'll click OK, paste the text again. And you will notice I don't need to go back out and copy it. It just remembers whatever is in the clipboard. So now you'll notice that the formatting is being controlled by my external CSS file.
The structure is being controlled by the structure that I gave to the content inside Word. You will notice when I click inside Academic Programs for example, it's a Heading 1, when I click inside Academic Departments, it's a Heading 2. All my paragraphs are coming in as separate paragraphs, and right down here the text that has bold applied to it inside Word, you will notice that that is inside of a strong tag. So it's not writing a custom CSS selector for that, it's actually using the HTML structure to achieve the same exact results within Dreamweaver. So copying and pasting text into Dreamweaver is likely to be a very common workflow for you, and because of that, Dreamweaver has a lot of different options within its Preferences to help control how the text is brought in.
Now this is a workflow, this copying and pasting of text in the Dreamweaver is a workflow that you are going to use a lot, but there is another way to bring text in the Dreamweaver from Word and we are going to take a look at that option in our next movie.
There are currently no FAQs about Dreamweaver CS6 Essential Training.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.