SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2008
    Posts
    455
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Code example styles

    Hi.

    Not sure if this is for the CSS section.

    Ive came accross several tutorial websites that have code examples on their pages that are coloured like you would see in the likes of Zend.

    Could anyone enlighten me as to how this is achieved?

    Thanks
    Michael.

  2. #2
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Could you actually post a URL showing what you mean? I'm not familiar with Zend.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2008
    Posts
    455
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.pixel2life.com/publish/tu...m_redirection/

    See how the code is coloured?
    I think it has to be done manually though

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Oh, okay, yeah, he did it with a table and the <pre> tag to show the code... and inside <pre> he has some spans with classes which, I didn't look but assume is CSS for the colours. Or, the colours were already there in whatever programme he first wrote the code in so it's already there somehow (I notice here at SP people sometimes post code and it just has all these colours and I guess it has something to do with their text editors, cause my code never goes psychedelic on SP : )

    So,
    <pre>
    the code with <spans> around everything
    </pre>

    Look at the Page Source and then search for "pre" and you'll see it.

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2008
    Posts
    455
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol ah wey, I just thought some clever person out there had come up with a good function or something that would colour the text automatically to look like code.

    Ah well.

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •