Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFINCLUDE with different font sizes

Status
Not open for further replies.

meimei

Programmer
Aug 19, 2003
2
US
I'm developing a website for handheld users.
I want to use cfinclude file that will shares
text between regular website and handheld website.
My problem is the font size for handheld website is
smaller than the regular website,
How can I use one file with cfinclude to show
different font sizes?
ANy one please help!
 
Hey Meimei,

I think the real question is how you'll differentiate which site they are supposed to get. Once that's established though the rest is easy. Here's a quick example assuming siteType contains "r" for the regular site or "h" for the handheld site.

<cfif siteType is &quot;h&quot;>
<cfset fontType=&quot;font size=&quot;&quot;1&quot;&quot;&quot;>
<cfelse if siteType is &quot;r&quot;>
<cfset fontType=&quot;font size=&quot;&quot;2&quot;&quot;&quot;>
<cfelse>
<cfset fontType=&quot;font size=&quot;&quot;3&quot;&quot;&quot;>
</cfif>

Then in the body of the page, just use this to set your fonts.

<cfoutput>
<#fontType#>This is our main webiste.</font>
</cfoutput>

You can set the first section of code in your application.cfm file and it will be available for all pages.

Hope this helps,
GJ
 
You could also just change the stylesheet

<html>
<head>
<cfif siteType is &quot;web&quot;>
<cfinclude template=&quot;style1.css&quot;>
<cfelse if siteType is &quot;pda&quot;>
<cfinclude template=&quot;style2.css&quot;>
<cfelse>
<cfinclude template=&quot;style3.css&quot;>
</cfif>
</head>

Hope that helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top