Goedkope merkkleding op www.kleren.com

Writing HTML Code in Dreamweaver

Share your DreamWeaver tips and resources here.

Moderator: Moderators Team

Writing HTML Code in Dreamweaver

Postby ichunez on Tue Feb 19, 2008 1:20 am

If you've never used Dreamweaver as an HTML editor before you may have never even noticed the three buttons at the top of the page: "Code", "Split", and "Design". Dreamweaver starts up by default in "Design view" or WYSIWYG mode.

If you're just learning how to write HTML or you want to get a sense of how your changes will impact your document, you can open code view and design view at the same time. The beauty of this method is that you can edit in both windows as well. So you can write the code for your image tag in HTML and then use design view to move it to another location on the page with drag and drop.

To view both at once, either:

* Click on the "Split" button (between Code and Design)
* In the View menu, select "Code and Design"

Once you're comfortable using Dreamweaver to edit your HTML code, you can change your preferences to open Dreamweaver in code view by default. The easiest way is to save the code view as a workspace. Dreamweaver will open in the last workspace you were using. If it doesn't simply go to the Window menu, and choose the workspace you want.
Code View Options

Dreamweaver is so flexible because it has so many ways to customize it and make it work the way you want it to. In the options window, there are code coloring, code formating, code hints, and code rewriting options you can adjust. But you can also change some special options within the code view itself.

Once you're in code view, there is a "View Options" button in the toolbar. You can also view the options by going into the View menu and choosing "Code View Options". The options are:

* Word Wrap wraps the HTML code so that you can view it without scrolling horizontally. Note, that this option does not insert any carriage returns in your code, it just displays the code so that it's easier to read.
* Line Numbers displays line numbers along the side of the code. It shows a line wrap symbol for lines that wrap longer than the view window.
* Hidden Characters displays special characters instead of whitespace that would display on a Web page. Such as a dot replaces a space, a double chevron replaces each tab, and a pilcrow or paragraph marker replaces each line break.
* Highlight Invalid Code highlights HTML that is incorrect in yellow. If you select the yellow tag, the Property Inspector will give you hints on how to fix it.
* Syntax Coloring turns on or off the color coding of your code. You change the colors of your color coding in the code coloring section of the preferences.
* Auto Indent makes your code indent automatically after a carriage return if the code above it is indented. You can change the size of the indent by changing the tab size in the code formating section of the preferences.

Editing HTML Code in Dreamweaver Code View

It's easy to edit HTML code in Dreamewaver's code view. Simply start typing your HTML. But Dreamweaver provides you with some extras that extend it beyond a basic HTML editor. When you start writing an HTML tag, you type <. If you pause right after that character, Dreamweaver will show you a list of HTML tags. These are called code hints. To narrow down the selection, start typing letters - Dreamweaver will narrow down the drop-down list to the tag that fits what you're typing.

If you're new to HTML, you can scroll through the list of HTML tags and choose various ones to see what they do. Dreamweaver will continue to prompt you for attributes once you've typed a tag. For example, if you type "<i", Dreamweaver will drop down to the <i> HTML tag, with the other tags starting with I following. If you continue by typing the letter "m", Dreamweaver will narrow it down to the <img> tag.

But code hints don't end at the tags. You can use code hints to insert:

* HTML attributes
* Class and ID names
* CSS properties

If the code hints do not appear, you can hit Ctrl-spacebar (Windows) or Cmd-spacebar (Macintosh) to get them to display. The most common reason why a code hint might not appear is if you switched to a different window before finishing your tag. Because Dreamweaver is keying off the typing of the character <, if you leave the window and return, you'll have to re-launch the code hints.

You can turn off the code hints menu by hitting the escape key.

Once you've typed your opening HTML tag, you'll need to close it. Dreamweaver does this in a natural way. If you type the "</" characters, Dreamweaver will close the tag that is most recently opened. This makes sure that your code stays valid, without nesting errors. This is slightly different to how other HTML editors, like Homesite close the tags. If you would rather have Dreamweaver behave like Homesite and close the tag immediately upon opening it, go into the code hints section of the preferences and select the Close Tags option that best suits your needs.

If you're not quite ready to switch over to editing your pages in HTML, but you'd like to watch the code as it's written, you should try the code inspector. This opens the HTML code in a separate window. It works just like code view, and in fact is basically a detachable code view window for the current document. To open the code inspector go to the Window menu and choose "Code Inspector" or hit the F10 key on your keyboard.

Dreamweaver will format HTML code however you would like it displayed. For example, if you use 3 spaces to indent, but never indent IMG tags, you can specify that formatting information in the code rewriting options. Then you go to the Commands menu and choose "Apply Source Formatting". This is a great way to get code written by someone else into a format familiar to you.

A feature that many HTML coders don't know about or don't use is the ability to collapse HTML code. This does not remove the tags from the document, but just remove them from view so that they aren't distracting to what you're working on. To collapse your code:

1. Select the section of code you want to hide
2. In the Edit menu, choose "Collapse Selection" from the "Code Collapse" sub-menu

An easier way is to select the code and then click on the code collapse icons that appear in the gutter.

If you want to hide everything except what is highlighted, choose "Collapse Outside Selection" in any of the above methods.

To expand collapsed code, simply double click on it. This opens the code up, and selects it. Then you can move that selection or delete it or add additional tags around it.

I use the collapse and expand feature all the time on pages where I don't want to edit the external template. I just select the content area I want to edit and collapse outside. Then I write my HTML. You can still view the page in Design view or preview it in a browser. The collapsed code is not removed from the document, simply hidden from view. I also use it when I'm working on a series of items. When I've finished one, I collapse it. I know I'm done when there is no code showing.

Code: Select all
Source: http://webdesign.about.com/od/dreamweavertips/a/aa061907.htm
ichunez
 
DNBucks:
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby mnk_xpert on Wed Feb 20, 2008 8:58 pm

shall i think that u wrote all this ur self instead of copypasting?
Ninjutsu Pakistan: http://www.pakninjas.com/
mnk_xpert
Member
Member
 
Posts: 347
Joined: Wed Nov 14, 2007 6:58 pm
DNBucks: 105
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby magicdave26 on Thu Mar 27, 2008 12:40 pm

lol thanks for the tips anyway !
magicdave26
Visitor
Visitor
 
Posts: 8
Joined: Wed Mar 26, 2008 3:12 pm
DNBucks: 115
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby lakeccrunner on Wed Apr 09, 2008 10:20 pm

Nice, Thanks for the tutorial, it's very helpful.
lakeccrunner
Member
Member
 
Posts: 422
Joined: Thu Apr 12, 2007 9:45 pm
DNBucks: 70
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby cybermandu on Fri Apr 11, 2008 1:23 pm

Thank you for the tips its really helpful.
cybermandu
Member
Member
 
Posts: 329
Joined: Thu Jan 18, 2007 9:59 am
DNBucks: 485
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby 10jamest on Tue Jul 08, 2008 7:28 pm

Dreamweaver works great to edit html code I used it for a long time. Unfortunately I only had the academic version of it that my school put on my computer and I lost it when I upgraded to Vista, now I am having to get used to html-kit
10jamest
Visitor
Visitor
 
Posts: 3
Joined: Tue Jul 08, 2008 7:12 pm
DNBucks: 45
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby NelaSabrina on Tue Jul 08, 2008 7:29 pm

Thanks for the tips! Dreamweaver is great for editing HTML code
User avatar
NelaSabrina
Member
Member
 
Posts: 238
Joined: Sun Jul 06, 2008 10:39 am
Location: Zadar, Croatia
DNBucks: 140
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby blue-sky on Thu Jul 10, 2008 3:56 pm

Thanks for sharing, actually i never use dreamweaver before.

Today i learn some basic things about dreamweaver..Thanks a lot again
blue-sky
Junior Member
Junior Member
 
Posts: 159
Joined: Sun Jun 10, 2007 4:08 am
DNBucks: 100
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby zodiaco on Tue Aug 26, 2008 6:58 pm

mnk_xpert wrote:shall i think that u wrote all this ur self instead of copypasting?


If he do copypaste and get cached he would be banned xP so is better write by your self ;)
zodiaco
Newbie Member
Newbie Member
 
Posts: 20
Joined: Mon Aug 18, 2008 12:28 am
Location: Florida, US
DNBucks: 0
[ Donate DNBucks ]

Re: Writing HTML Code in Dreamweaver

Postby bobis on Fri Sep 26, 2008 5:54 am

I really never noticed that stuff, thanks for the tip on the site.
Im a flash man myself!
Monterey Park Computer Support

want a higher alexa rank free, really free, PM me.
User avatar
bobis
Advanced Member
Advanced Member
 
Posts: 855
Joined: Mon Oct 01, 2007 5:10 am
Location: Turn around!
DNBucks: 5162
[ Donate DNBucks ]
Blog: View Blogs (2)

Re: Writing HTML Code in Dreamweaver

Postby NoelF1 on Wed Oct 22, 2008 11:43 am

cool stuff there, i normally use some notepad or something but this tut made me a bit aware of dreamweaver and how good it is!
NoelF1
Member
Member
 
Posts: 296
Joined: Sat Jun 30, 2007 4:37 pm
Location: Malta
DNBucks: 5
[ Donate DNBucks ]


Return to DreamWeaver Tips and Resources

Who is online

Users browsing this forum: No registered users and 0 guests