473,748 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to say "use the user's INPUT font"?

Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?

Most browsers have the ability for the user to pick his or her own
preference for what font to use inside of <INPUTtags. My question
is, is there a way in HTML or StyleSheet language to say something like
this:
<h4>Here are some values - some are hardcoded, and others are input
feilds:</h4>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 1
</FONT>
<p>
<INPUT type="text" value="Value 2">
<p>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 3
</FONT>
<p>
<INPUT type="text" value="Value 4">
<p>

Essentially, I would like Value 1, Value 2, Value 3, and Value 4 to all
end up being in the same font so they look good together, and have that
font adhere to the user's preferences, NOT mine. (I know I can use
StyleSheets to force my own font preference onto the user for the input
fields, but I'd like to be polite to the user and use the user's
preferences.)

Dec 4 '06 #1
9 4527
Ma*****@gmail.c om writes:
Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?
Yes - just say nothing at all. What you want is the default behavior if no
<fontelement or CSS is used.
Essentially, I would like Value 1, Value 2, Value 3, and Value 4 to all
end up being in the same font so they look good together, and have that
font adhere to the user's preferences, NOT mine.
An admirable goal. I wish more web authors shared it.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Dec 4 '06 #2
Sherm Pendley <sp******@dot-app.orgwrites:
Ma*****@gmail.c om writes:
>Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?

Yes - just say nothing at all. What you want is the default behavior if no
<fontelement or CSS is used.
No, the OP wanted plain body text to be in the font the user has
chosen for <inputelement s.

--
Ben.
Dec 4 '06 #3
Ma*****@gmail.c om writes:
Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?

Most browsers have the ability for the user to pick his or her own
preference for what font to use inside of <INPUTtags. My question
is, is there a way in HTML or StyleSheet language to say something like
this:
<h4>Here are some values - some are hardcoded, and others are input
feilds:</h4>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 1
</FONT>
<p>
<INPUT type="text" value="Value 2">
<p>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 3
</FONT>
<p>
<INPUT type="text" value="Value 4">
<p>

Essentially, I would like Value 1, Value 2, Value 3, and Value 4 to all
end up being in the same font so they look good together, and have that
font adhere to the user's preferences, NOT mine.
That sounds like an admirable aim, but it may backfire in that you
will *not* be adhering to the user's preference! The user has, most
likely, chosen some other *font* for text that in not in an <input>
control, and your plan will involve ignoring that choice.

That said, if the purpose it to display input controls that have
already been set or the user has no authority to change (and hence the
requirement for a similar look) your best bet is use one but mark it
as read-only.

<input type="text" readonly value="Value 1">
<input type="text" value="Value 2">

--
Ben.
Dec 4 '06 #4

Sherm Pendley wrote:
Ma*****@gmail.c om writes:
Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?

Yes - just say nothing at all. What you want is the default behavior if no
<fontelement or CSS is used.
That doesn't do what I'm talking about.
People often pick a different font for the user input fields than they
use for the rest of the page: Often this is so there is a proportional
font for most content, but a fixed-width font for the input fields.

Dec 4 '06 #5
Ben Bacarisse wrote:
That said, if the purpose it to display input controls that have
already been set or the user has no authority to change (and hence the
requirement for a similar look) your best bet is use one but mark it
as read-only.

<input type="text" readonly value="Value 1">
<input type="text" value="Value 2">
That was my first attempt. But when I do that, the browser tends to
make it very hard to read them, by greying it out. I want it to be
very visible and clear without the user needing to sqint.
As for why I want to use the same font - it's becasue there's a grid of
values that looks a little bit spreadsheet-ish, some editable, and some
not editable. They look better and line up nicer when they are a
consistent font.

Dec 4 '06 #6
Ma*****@gmail.c om writes:
Ben Bacarisse wrote:
>That said, if the purpose it to display input controls that have
already been set or the user has no authority to change (and hence the
requirement for a similar look) your best bet is use one but mark it
as read-only.

<input type="text" readonly value="Value 1">
<input type="text" value="Value 2">

That was my first attempt. But when I do that, the browser tends to
make it very hard to read them, by greying it out.
Can you post a URL? The elements can be styled. I admit I don't know
how widely supported that is across browsers, but I was able to make
all input controls bold so I can't see why you could not make the
readonly ones have whatever weight and colour you like.

Of course you don't want all distinctions lost since there is a
distinction to be made for the user, but you can choose it yourself:

input { font-weight: bold; }
input[readonly] { border: 0; }

(If you need support in IE<7 you can't use attribute selectors like
that but you will be able to use a class.) This is obviously only one
styling choice out of many.

The big win (if you are indeed authoring for the WWW) is that your
markup says what you mean.

--
Ben.
Dec 4 '06 #7
In article <11************ **********@80g2 000cwy.googlegr oups.com>,
Ma*****@gmail.c om wrote:
As for why I want to use the same font - it's becasue there's a grid of
values that looks a little bit spreadsheet-ish, some editable, and some
not editable. They look better and line up nicer when they are a
consistent font.
Am I missing something here? Why don't you just set them all to the same
font?

:
<HEAD>
<STYLE type="text/css">
BODY, INPUT, TEXTAREA { font-family: monospace; }
</STYLE>
</HEAD>
:

--
If you really must contact me by email, visit
http://rumkin.com/tools/compression/base64.php
and decode the following string of characters:
RW1haWw6IHBoaWx yb25hbkBibHVleW 9uZGVyLmNvLnVr
Dec 5 '06 #8
Philip Ronan <no****@example .invalidwrites:
In article <11************ **********@80g2 000cwy.googlegr oups.com>,
Ma*****@gmail.c om wrote:
>As for why I want to use the same font - it's becasue there's a grid of
values that looks a little bit spreadsheet-ish, some editable, and some
not editable. They look better and line up nicer when they are a
consistent font.

Am I missing something here?
Yes :-)
Why don't you just set them all to the same
font?

:
<HEAD>
<STYLE type="text/css">
BODY, INPUT, TEXTAREA { font-family: monospace; }
</STYLE>
</HEAD>
:
The OP wanted to be able to use the font the user has chosen for INPUT
controls. This may not be the same as monospace.

--
Ben.
Dec 5 '06 #9
Ma*****@gmail.c om wrote:
Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?

Most browsers have the ability for the user to pick his or her own
preference for what font to use inside of <INPUTtags.
Where? I've never seen this in IE or Firefox.
My question
is, is there a way in HTML or StyleSheet language to say something like
this:
<h4>Here are some values - some are hardcoded, and others are input
feilds:</h4>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 1
</FONT>
There isn't any way to do this. In IE you might be able to get the
actual font properties being applied in CSS to an actual INPUT field on
the current page using Javascript, and then apply them to other parts of
the page, but that's a mess, it requires Javascript, and it will only
work in IE.
<p>
<INPUT type="text" value="Value 2">
<p>
<FONT face="same as user's input font preference" size="same as user's
input font preference">
Value 3
</FONT>
<p>
<INPUT type="text" value="Value 4">
<p>

Essentially, I would like Value 1, Value 2, Value 3, and Value 4 to all
end up being in the same font so they look good together, and have that
font adhere to the user's preferences, NOT mine.
If the user's preference is to have different fonts in different places,
and had gone out of his way to configure the browser that way, then
making the fonts all the same wouldn't be adhering to the user's
preferences, it would be violating them. Why would you have a better
idea what looks good to the user than the user does?

(I know I can use
StyleSheets to force my own font preference onto the user for the input
fields, but I'd like to be polite to the user and use the user's
preferences.)
Then why do you want to muck around with *any* of his fonts?
Dec 5 '06 #10

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

Similar topics

1
5389
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is once the user inputs too much data (about 3 paragraphs or 2020 characters) when they click on the submit button nothing happens. When I say nothing happens I mean just that, nothing at all happens the page just sits there as if nothing at all happened. If I remove one line for the textarea,...
1
2202
by: Matt Adams | last post by:
I want define for a couple of words inside a longer text with different font specifications. I declared it like: ....text before.... <FONT class=aaa> these text should get other attributes </FONT> text after However when I let this html source validate the FONT tag is marked as not compatible with XHTML. So how do I specify otherwise new font attributes to only a few words?
7
3089
by: Andreas Prilop | last post by:
Internet Explorer displays <tt>, <code> etc. in a smaller font size: http://www.unics.uni-hannover.de/nhtcapri/temp/monospace.html I don't like the idea that monospaced text is displayed in a different size. Should we state "font-size: 100%" with monospaced text? -- Meanwhile at the Google Ranch ... "I can't read this bloody site; it's all Falsh and JavaScrap." "Forget it and move on! Still 2 718 281 828 pages to crawl."
2
1785
by: David Trimboli | last post by:
If you look at http://www.trimboli.name/klingon/, you'll see that the headers on the page are displayed in small-caps. Usually, this is desired. However, the header "may'vaD ghuHmoH QoQ"* is surrounded by <span lang="tlh"> ("tlh" for "tlhIngan Hol"), and I have put a declaration of "font-variant: normal" in the main stylesheet. I can't figure out why the Klingon title is still in small-caps. I want all Klingon phrases to appear in normal...
26
2521
by: Chris Potter | last post by:
Hello everyone. I am taking my first course in C and in one of my assignments i need to print out an array that could have anywhere from 0 to 100 positive integers in it (a negative integer is used to stop input), and i have to print 8 integers per line. The code that i have works, and does exactly that, but i feel a little uneasy because i am using two breaks. I would like to hear any comments about this approach, and what i might do to...
0
1211
by: Chad Sanford | last post by:
I have some server side code that instantiates a font object that is then used for generating a chart. It has worked great on many machines, but I have run into one where it is throwing a System.ArgumentException. From the documentation, that would seem to indicate the font is not present, but since I am using generic sans serif I have my doubts about that. The offending line of code is:
1
1885
by: Achim Domma (SyynX Solutions GmbH) | last post by:
Hi, is there a possibility to set the font size to a percent value of the "top level" font size? For example: The font size of the body might be 100% and I have a div which should have a font size of 80% of this value, independent of other tags around this div:
4
10823
by: david.karr | last post by:
I'm a CSS newbie, but I was browsing through the css files in the YUI library, and I noticed the following line: body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font- size:small;*font:x-small;} I understand everything but the "/1.231". Is that something like a multiplier on the EM size? I can't find an example of that in the CSS spec.
11
5025
by: fniles | last post by:
One of our application uses VB6 and Access97 database. Another application uses VB.NET 2005. This morning for about 15 seconds when the application tries to read either a query or a table from the database, in in both VB6 and VB.NET applications, I got the error "The Microsoft Jet database engine cannot find the input table or query 'myTable'. Make sure it exists and that its name is spelled correctly." Also, I got the error "The...
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.