• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

css

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got a css style sheet which cantain:
.smallnote { font-face: MingLiu; font-size:10px; color:#ff66cc }

in the html, it will work for either:
<td><FONT FACE="MingLiu" CLASS="SMALLNOTE">test</font>
</td>
or
<td class="smallnote">test</td>

but not:
<td><FONT CLASS="SMALLNOTE">test</font></td>
does any one can help me with this?
thanks!
 
Sheriff
Posts: 67752
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
CSS is case-sensitive. "smallnote" and "SMALLNOTE" are NOT the same name.
Why do you feel you have to uppercase the name?
hth,
bear
[ February 25, 2003: Message edited by: Bear Bibeault ]
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Bear for the quick response.
I didn't realize that.
I have try to change all upper case "SMALLNOTE" to lower case but it still doesn't work.
It doesn't work when I did NOT specify for the font face. Correct me if I am wrong.
I really appreciated that.
 
Bear Bibeault
Sheriff
Posts: 67752
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
Ah, I didn't catch that in your original code. The FONT tag is deprecated and should not be used. To get the effect you want use the <span> tag instead.
E.g.

With CSS, tags like FONT are no longer required.
hth,
bear
[ February 25, 2003: Message edited by: Bear Bibeault ]
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks bear,
I got another related question.
if I don't specify the class for one word. It will display as default font.
can i change the default font which i want to without specifying the class, font?
e.g. something like declaring at the top of the page?
 
Bear Bibeault
Sheriff
Posts: 67752
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
CSS is an incredibly powerful tool and I'd suggest you get to know how to use it. This book is a great way to learn it.
To answer your question, to apply a default font to all text on a page, place the following in your <head>:

You can, of course, substitute whatever font values make the most sense for you. The above style rule will apply the styles to all text in the body, as well as within <td>'s (which for some reason are independent of body).
hth,
bear

P.S. This site is a good reference for CSS.
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got 2 more questions after reading the tutorial:
1) is that mandatory to put this before defining the style sheet?
<HTML>
<STYLE TYPE="text/css">
<!--
2) what's the difference between font-family and font-face?
thanks!
 
Bear Bibeault
Sheriff
Posts: 67752
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


1) is that mandatory to put this before defining the style sheet?
<STYLE TYPE="text/css">


Both HTML 4 and XHTML 1 list the type as a required attribute, but all browsers that I've used seem to be pretty lenient about leaving it off.


2) what's the difference between font-family and font-face?
thanks!


font-face is not a valid CSS attribute.
hth,
bear
 
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jackie Wang:

1) is that mandatory to put this before defining the style sheet?
<HTML>
<STYLE TYPE="text/css">
<!--
thanks!


If u r using any toold tool to check section 508 or w3 standards then its mandatory
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic