473,221 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Response.Write font size & face



Running an asp page that has the following code:

<%
response.Write MonthName(Month(date))
%>
&nbsp;
<%
response.Write Day(date)
%>
,
<%
response.Write Year(date)
%>

I would like to modify the font size & face to be something other than
the "default" of Times New Roman. How can I do this?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 16333
<%
Dim strDate
Dim strFont
strDate = Date()
strFont = "<font style=""font-size: 12px; color: #ff0000; font-family:
verdana"">"

Response.write strFont & strDate

%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
PorkyJr <no****@nospam.net> wrote in message
news:uQ**************@TK2MSFTNGP11.phx.gbl...


Running an asp page that has the following code:

<%
response.Write MonthName(Month(date))
%>
&nbsp;
<%
response.Write Day(date)
%>
,
<%
response.Write Year(date)
%>

I would like to modify the font size & face to be something other than
the "default" of Times New Roman. How can I do this?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
PorkyJr wrote:
Running an asp page that has the following code:

<%
response.Write MonthName(Month(date)) <snip> %>

I would like to modify the font size & face to be something other than
the "default" of Times New Roman. How can I do this?


Do you want to change it for the entire page? If so, use the body tag's
style attribute (or css).

If you want to only affect this piece of text, then wrap it in a span:

<span style="font-family:sans-serif">
<%
response.write ...
....
%>
</span>

This is not really an asp question, so any follow-ups should go to a css or
html newsgroup.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3
"PorkyJr" <no****@nospam.net> wrote in message
news:uQ**************@TK2MSFTNGP11.phx.gbl...


Running an asp page that has the following code:

<%
response.Write MonthName(Month(date))
%>
&nbsp;
<%
response.Write Day(date)
%>
,
<%
response.Write Year(date)
%>

I would like to modify the font size & face to be something other than
the "default" of Times New Roman. How can I do this?


Ideally, you would apply your format via a stylesheet (CSS), and you would
wrap your output above in some sort of logical container (perhaps a span
with a class applied to it, if this isn't already represented by an element
in HTML). I'm going to assume you are new to CSS, so I'm not going to
discuss including an external stylesheet (though that is the preferred
method). However, you could put the styles in the head of your (X)HTML
document like so:

<head>
<title>My Title</title>
<style type="text/css">
..todayDate
{
font-family: arial,sans-serif;
font-size: 125%;
}
</style>
</head>

The above code will cause the items in your (X)HTML that have
class="todayDate" to use arial font (or the default sans-serif font if arial
is not available) and to be 25% larger than the text in the parent
container. This really isn't the place to go into this, though, so I'm
going to refer you to the CSS specs. It's a good resource to reference:
http://www.w3.org/Style/CSS/#specs

Also, your code is somewhat inefficient and harder to read because you
switch between ASP and HTML without a real need. If you are going to do
that, you should consider using the shorthand version of Response.Write,
which is <%= %>. Some cleaner examples below:

<span class="todayDate">
<%
Response.Write MonthName(Month(date))
Response.Write "&nbsp;"
Response.Write Day(date)
Response.Write ", "
Response.Write Year(date)
%>
</span>

or

<span class="todayDate">
<%=MonthName(Month(date))%>&nbsp;<%=Day(date)%>, <%=Year(date)%>
</span>

Hope this helps.
Regards,
Peter Foti
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Sargent | last post by:
Hi All, how do I get this right..? Response.Write "<font face="MS Pゴシック, MS P明朝, MS UI Gothic, MS ゴシック, MS 明朝">" &FileTooBig &"</font>" &"<br>" ?...
2
by: Michael | last post by:
Hi, How can I set my default display font size, type for a web page, or a <table>? I dont want to write <font size=....> everywhere, especially inside each <td>. I know this is HTML...
2
by: Rob McLennan - ZETLAND | last post by:
Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm testing out a search form for my company's website which is done in ASP. The results are displayed as per the code shown at the...
14
by: Hugh Welford | last post by:
Hi - trying to display a memo field using response.write but it truncates it. Is there a size issue with response.write? If so how do I get round it and to be able to display the whole memo field ...
24
by: Harris Kosmidis | last post by:
I have a site up and running (www.solsoft.gr). I tested it with FF2 and IE6 and works ok with some IE hacks. Ok the CSS isn't good cause I started designing it with another look and the customer...
7
by: carterweb | last post by:
This is how I do it now. 1. Determine the dimensions of the rectangle. 2. Set a my font size to a fixed maximum size. 3. Apply the font my string and measure the string using the graphics...
30
by: Takehiko Abe | last post by:
I have a <pelement with <ttinside: ;;; <p>A paragraph contains <tt>tt element</tt>.</p> I would like to set the font-size of the TT to the same as the containing <p>. This does not seem to...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
0
by: musosmiffy | last post by:
Hi, I have been trying to get the following working for days - I wonder if anyone could help me? I am trying to list a set of database entries as a newspaper column. I am using classic ASP (not...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.