Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

Miscellaneous Formatting

 
<br>Line break
&nbsp;Non-breaking space token
<p align="position">Text alignment
<!-- Comments -->Hidden comment line
Along with or in place of block elements, you can use the br element to force a line break at will. Conversely, there may be times where you want to insure that the flow of text does not break between two words. For this you will use non-breaking space token (&nbsp;). No doubt, you will also want to know how to align your text to the left, right or in the center of your web page. And last but not least, you may be interested in how to place text in your HTML source code that remains hidden behind the scenes of the resulting web page.

These are all covered in more detail below:


Forcing a Line Break


<br>

The all-purpose br element forces a line break anytime you want without having to place the text within a block level element. The br element is known as an 'empty' element because unlike other HTML elements, it typically contains no content or text between a start and end tag, and moreover does not even have an end tag. Hence the br element is rendered in HTML simply as <br>. Put as many of them as you like. Each instance of the <br> tag creates the equivalent of one line break on your web page.

The <br> tag is versatile and lends itself to numerous applications. For example, you could simulate paragraphing without using the p element by putting two <br><br> tags whenever you wish to begin a new paragraph. Or you could create extra blank space by stringing 3 or more <br> tags together. Example:

Example 1 - SOURCE CODE

This is the first line.<br><br><br><br>The next line appears here after creating some vertical blank space using a string of 'br' elements.


Click here to view the result of Example 1...


About the Non-breaking Space Token


&nbsp;

As well as ignoring line breaks, web browsers also ignore all extra inter-word white space that appears in the source code. Hence if you are typing some text in your HTML source code and you press the spacebar on your keyboard three times attempting to create an extra long space in between words, the result on your web page will still only be a single inter-word space.

To create extra horizontal or inter-word space, many web authors will string together a bunch of non-breaking space tokens &nbsp; in the source code although this is not what this was originally intended for. As the name implies, the original purpose of the non-breaking space token is to prevent the flow of text breaking to the next line in between two words that the author wishes to be displayed on the same line no matter what. For example, if the author was referring to the name Pepsi Cola and he wanted to be certain that the Cola part didn't break to the next line on the web page he would type Pepsi&nbsp;Cola in the source code.

Aligning Text


<p align="position">

By default, all text is aligned to the left margin of the web page or the left margin of the block element containing the text. You may, however, explicitly set the alignment of your text in various other manners. This accomplished by using the align attribute in the start tag of the block element containing the text and then using either left, right, center or justify as the value. This will apply the following effects respectively:

  • left - The beginning of each new line of text is aligned flush with the left margin of the block element.
  • right - The end of each line of text is aligned flush with the right margin of the block element.
  • center - Each line of text is aligned in the center of the block element.
  • justify - Each line of text is aligned flush to both the left and right margins of the block element. (For example, most of the text on the web page you are currently viewing is justified to both margins.)

Example 2 - SOURCE CODE

<p align="right">In this paragraph, the text is aligned to the right.</p>


Click here to view the result of Example 2...


Comment Lines


As your web pages become more and more complex so will the source code you write to produce said web pages. You may eventually find it difficult to navigate your way around what has become a confusing mess of color-coded markup interspersed with your visible text. In this predicament, it will help to place titles and 'signposts' in and about your HTML source code to help you locate important sections that you frequently edit. Using special 'comment' <!-- --> delimiters allows you to place text in the source code that web browsers will ignore when displaying the resulting web page.

In the example below, the words "INTRODUCTORY PARAGRAPH" will not appear on the resultant web page:

Example 3 - SOURCE CODE

<!-- INTRODUCTORY PARAGRAPH -->
<p><font face="verdana" size="2">This section will introduce the aspiring web author to fundamentals of writing Hypertext Markup Language...</font></p>



Next, let's learn an easy way to create headings and subheadings on your web page...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~BACK TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell