• 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

setting font color in the HTML code tags

 
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

I started a developer blog on http://www.blogger.com.

In the areas, where I wish to place my code, I use the follow scheme (in order, to differentiate it from my narrative) to surround the code:


The problem I am experiencing is that I am unable to display the font color as white.

Any suggestions, hints, and assistance is greatly appreciated!

Many, many thanks!

[ June 13, 2007: Message edited by: Unnsse Khan ]
[ June 13, 2007: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Unnsse,

you can check your html and css at www.w3c.org (it's free), or use the WebDeveloper's plugin for FireFox (really handy!)

In the meantime, try this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test</title>
<style type="text/css">
code{
font-family: 'new courier';
color: white;
}
table{
background-color: black;
}
</style>
</head>

<body>
<table>
<tr><td><code>public class SampleClass {}</code></td></tr>
</table>
</body>
</html>[/CODE]

Herman
 
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
font-face? font-color?

What CSS reference are you using?
 
Bear Bibeault
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
And Herman's suggestion to factor the CSS out of the HTML is spot-on.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Herman,

I think we ended up with a confusing code as the code tag itself defines the font. We probably should use either the code tag or the CSS for the font.

Regards,
Dan
 
Unnsse Khan
Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the responses, Herman, Bear, and Dan!

The CSS outside the inline HTML tags doesn't work because Blogger already has the beginning < html > and < head > tags inserted outside every upcoming blog posting, by default. That way end users are allowed to insert common HTML tags (< br >, < b >, < em >, < a href >, etc.) in their postings.

I got it working by doing this:



I still didn't like the outcome, so I'm going to search for BlogSpot / Blogger desktop client that does this for me. If anyone has any suggestions then instead of posting here, please just send me a private message.

All the best,
[ June 13, 2007: Message edited by: Unnsse Khan ]
 
Bear Bibeault
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
You can place style tags for CSS just before the code block. They don't have to be in <head>.
 
reply
    Bookmark Topic Watch Topic
  • New Topic