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

Can't format data after a response.write!? 1

Status
Not open for further replies.

lengoo

IS-IT--Management
Jan 15, 2002
381
GH
Hi Guys
I've been developing a basic webpage with a database using the wizard in Frontpage XP.
I've been editing the code to get it to do what I want. I've got a bit of code

<%response.write &quot;<a href=&quot;&quot;&quot; & FP_FieldVal(fp_rs,&quot;Hyperlink&quot;) & &quot;&quot;&quot;>&quot; & FP_FieldVal(fp_rs,&quot;News&quot;) & &quot;</a>&quot;%>

which displays the data as a hyperlink which is working fine. However, I can't seem to change the font of this, it's always defaulting to Times New Roman but I want it to be Verdana. I've put the <font> tag around the whole lot and even tried to set the standard format of the document to be verdana but no such luck. Whatever I do, it appears as Times New Roman.
Any ideas????
 
You could use CSS either in the head of the document to change all anchor tags to your new font:
Code:
<head>
<style>
   a{
      font-family: verdana;
   }
</style>
...
or you can define a class that will only affect the tags that subscribe to it:
Code:
<style>
   .myAnchor{
      font-family: verdana;
   }
</style>
...
<a class=&quot;myAnchor&quot; href=&quot;#&quot;>This is verdana</a>
<a href=&quot;#&quot;>This is not</a>

or you can define this style using inline style directly in the tag:
Code:
generic example:
<a href=&quot;#&quot; style=&quot;font-family:verdana;&quot;>Verdana!</a>

your code:
<%
Response.Write &quot;<a href=&quot;&quot;&quot; & FP_FieldVal(fp_rs,&quot;Hyperlink&quot;) & &quot;&quot;&quot; style=&quot;&quot;font-family:verdana;&quot;&quot;>&quot; & FP_FieldVal(fp_rs,&quot;News&quot;) & &quot;</a>&quot;%>

It is also a good idea to stack up several fonts in case the user doesn't have the first they will get your second choice, etc
Code:
<style>
   a{
      font-family: verdana, courier, serif;
   }
</style>
or
<a href=&quot;#&quot; style=&quot;font-family: verdana, courier, serif;&quot;>Click me</a>


Hope that helps :)

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Ain't you bored of stars, Tarwn ?
LOL LOL LOL Water is not bad as long as it stays out human body ;-)
 
Nah, they all blur into one big smear after a while ;)
beerpassout.gif


-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top