Whatever message this page gives is out now! Go check it out!

cfhtmlhead

Last update:
May 18, 2026

Description

Writes text to the head section of a generated HTML page.

Category

Syntax

<cfhtmlhead 
 text = "{{text}}">
Note: You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

See also

Attributes

Attribute
Req/Opt
Default
Description
text
Required
Text to add to the <head> area of an HTML page.

Usage

Use this tag for embedding JavaScript code, or putting other HTML tags, such as meta, link, title, or base in an HTML page header. If you use this tag after the cfflush tag on a page, an error is thrown.

Example

<!--- This example adds a favicon to the HTML Head of every page view. The extra CRLF at 
the end cleans up view source. Note the embedded tag uses double quotes and the cfhtmlhead 
text attribute uses single quotes, but it could be the other way around too. 
---> 

<cfhtmlhead 
text='<link href="/blog/custom/img/favicon.ico" rel="shortcut icon" type="image/x-icon">#chr(13)##chr(10)#'>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page