• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to specify different fonts with different font sizes in Stylesheets?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want Tahoma with font-size 13 px.
If this is not available , then I want to use Verdana with 11px.

With same font size & different fonts we can achieve by using comma delimiter as like

FONT-SIZE: 13px;

FONT-FAMILY: Arial, Tahoma.

But,with different size how to declare?
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there's an option of specifying several sizes. For each size, you would have to create a separate style class.
 
Ruchita Reddy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Annie Smith:
I don't think there's an option of specifying several sizes. For each size, you would have to create a separate style class.



Hai,

Thanks for u'r early reply.

But, for the same text , how to specify different style classes i.e
incase of first class font is not available on the system, we have to use second class font with different font size.

My HTML code is like this

<td width="390" valign="top" class = "textenglish">

<p class="textenglish">We can usually recognize a prospective restaurantjust by its name, which may recall the country that the owners

</p>
</td>

- Ruchita
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The browser matches the closest size in the font if that specific size is not found.
 
Ruchita Reddy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Annie Smith:
The browser matches the closest size in the font if that specific size is not found.



Is there any way to handle by the CSS?
I don't want browser handling in this case.There is a probability of content mismatch in our application due to browser handling.


-Ruchita
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ruchita Reddy:

Is there any way to handle by the CSS?



Yes, you could specify it in CSS. But that should not matter much. As far as possible, specify the sizes which are always available in all fonts. Specifying other sizes would make the browser use its logic and produce weird results.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a thing to do with JSP. Moved to HTML/Javascript.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the specs here: http://www.w3.org/TR/REC-CSS2/fonts.html

It tells you how the browser handles it.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic