Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hey.

    This can be with CSS I know, but just wondering if anyone knew of a more efficient way.

    I am writing some beginners tutorial on programming/scripting languages).

    They will all cover the basics (declaring variables, looping, conditionals etc)..

    For code clarity I would like for instance the lines that declare variables as one color.. and a different color for lines that output strings/characters and so on.

    eg..
    Code:
    int i; // color = green perhaps?
    String name;
    name = "bfsog"; // color = red?
    
    System.Out.println("Value of name: " + name + " .");
    Will it just be easier to define rules for the different styles I want, as there will not be that many I presume.

    Look forward to hear from you.

  2.  

  3. #2
    Member
    Join Date
    May 2005
    Location
    Rochester, NY
    Posts
    83
    Member #
    10054
    I think the best way is to create CSS classes to represent the different characteristics you want the text to have. That way you can reuse them as needed.
    michael murphy
    Professional Web Development
    http://www.letsgomurphys.com/

  4. #3
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    the way mentioned above is best for example:
    css:
    Code:
    SPAN.int {color:#000066;font-weight:bold;}
    SPAN.comment {color:#cccc00;}
    SPAN.string {color:#ff0000;}
    SPAN.syntax {color:#000066;font-weight:bold;}
    SPAN.num {color:#440044;}
    HTML Code:
    <span class="int">int</span> i; <span class="comment">// color = green perhaps?
    </span>
    name = <span class="string">"bfsog"</span>; <span class="comment">// color = red?</span>
    
    System.Out.println(<span class="string">"Value of name: "</span> + name + <span class="string">" ."</span>);
    Thee Pyro Wolf


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:53 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com