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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.css with custom tag? 1

Status
Not open for further replies.

doyle9732

Programmer
Apr 12, 2002
185
CA
We have a custom tag that displays new journals that have arrived in the library, invites users to join an email list etc. I have tried to add the style sheet that the rest of the library pages use, and I can't seem to capture it. I've tried it as the <link href="libraryfont.css" rel="stylesheet" type="text/css">, I've tried it with a <cfinclude template="libraryfont.css"> and in all the dsp_name.cfm files. Yet, the page does not take on the look of the css.

Is it possible to include the stylesheet with a custom tag?

Stephanie
 
<link href="libraryfont.css" rel="stylesheet" type="text/css"> suggests that the css file is in the same folder as the cfm page. is this correct?

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
yes, I put a copy in the custom tag folder.

Stephanie
 
css is more client side than server side.

if your cftemplate is at

your css document has to be in

it shouldn't matter where it is in relation to the custom tag, just the page that calls it.

Code:
<html>
<head>
<link href="mycss.css" rel="stylesheet" type="text/css">
</head>
<body>
<cf_customTag>
</body>
</html>

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
likewise

if your cf template is in

and your css is in

your like would look something like this in your template, not the custom tag.

<link href="../css/mycss.css" rel="stylesheet" type="text/css">


If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
This is what has always been in the code for todayjournal.cfm:

<html>
<head>
<title>XRCC Library -- Today's Journals List</title>
<link href="libraryfont.css" rel="stylesheet" type="text/css">
</head>


<body bgcolor="#ffffff" class="libraryfont">

<cfinclude template="journalsCustomTag/journals.cfm"></p>

</body>
</html>

but it doesn't pick up the style sheet.

the .css file is in the same folder as the todayjournal.cfm file, yet when I changed the link to ../libraryfont.css it worked. I just wasn't seeing beyond the calling file and the css file being in the same folder.....once I included the journalsCustomTag/journals.cfm, I was in a different folder.

So, problem solved, yet again.....thanks BombBoy....you're the best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top