Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Display code with syntax highlight
Old 06-22-2006, 12:43 PM Display code with syntax highlight
Novice Talker

Posts: 12
Trades: 0
Hello,

on some site there are code examples on the html page with syntax highlighting. How can I make such output? Is it CSS or HTML relevant or some 3rd party tool generated the site maybe?

Thanks!
elmu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-22-2006, 02:21 PM Re: Display code with syntax highlight
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Why don't you show us 'some site' that has the feature you're talking about.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-22-2006, 05:08 PM Re: Display code with syntax highlight
Extreme Talker

Posts: 160
Trades: 0
Without an example it is difficult to guess but perhaps the site you are thinking of is using PHP's own built-in highlighting :

PHP Code:
<?php
ini_set
("highlight.html","#ff0000");
ini_set("highlight.comment","#999999");
ini_set("highlight.keyword","#0000ff");

$html "<?php \n#generate some html\necho \"<html>\n<head>\n<title>Example</title>\n</head>\n<body>\n</body>\n</html>\";\n?>";
highlight_string($html);

?>
It would probably be better to set the colours in your php.ini file instead.
ElectricSheep is offline
Reply With Quote
View Public Profile
 
Old 06-22-2006, 05:15 PM Re: Display code with syntax highlight
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
If you're seeing it on a website it's also possible there are just classes associated with certain lines of text and the highlighting is being done with css. Not really any different than how you would style any element on a site.

A link to a site would be helpful to see how it's being done in the partucular sites you're referring to.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Display code with syntax highlight
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59334 seconds with 12 queries