You are hereForums & Blogs > Blogs
Register   |  Log In
 Richard Howells' Blog
Minimise
Mar 16

Written by: RichardHowells
16 March 2008 

Frankly my original recommendation for formatting code snippets was rubbish.

Some reseach in the DNN docs (poor) led me to the docs for FCKEditor (as used by DNN and much better docs).  They told me how to create my own set of styles for the editor (surprisingly simple).  Back on the DNN site I found in the forums information on how to integrate my new styles with the site.

So now my editor styles file looks like this...



<?xml version="1.0" encoding="utf-8" ?>
  <Styles >
  <Style name="Code" element="div">
    <Attribute name="class" value="code" />
  </Style >
  <Style name="Normal" element="span" >
    <Attribute name="class" value="normal" />
  </Style >
</Styles>

 
 
 
 

And my added CSS rule looks like this...(Update 18March08.  Actually it doesn't.  I implemented Matin's suggestion from the comments.)

.code
{
       background-color: #ffff99 ;
       border-style: groove;
       font-family: 'Courier New' , Courier, monospace;
       font-size: x-small;;

}

I hope you like it! 

Tags:

4 comments so far...

Re: Learning more about DNN/CSS Styling

Hi Richard,

Its nice to be able to format code this easily, however I find that there a little too much contrast, borh in the color and the border. Also you may consider to slightly adjust the margins. Here's an example

.code
{
background-color: #ffeecc;
border-width:thin;
border-style: solid;
border-color: lightgray;
margin: 1px;
padding: 10px;
font-family: 'Courier New', Courier, monospace;
font-size: x-small;
}

Cheers, Martin

By mjmoene on   18 March 2008

Re: Learning more about DNN/CSS Styling

Hi Martin,

I like it. I've implemented it. I struggle a bit with anything 'artistic'

Thank you.

By RichardHowells on   18 March 2008

Re: Learning more about DNN/CSS Styling

Sorry Richard,

One more time...
lightgrey is not a standard CSS color and I usuallly don't use Internet Explorer that would have reminded of that.

Maybe better specify the color like:
border-color: #bbb; /* same as #bbbbbb */

Cheers, Martin.

By mjmoene on   18 March 2008

Re: Learning more about DNN/CSS Styling

Got it.

By RichardHowells on   18 March 2008

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
 Search
Minimise

Dynamisys is based near Swindon, Wiltshire, in the South West, and works with customers located throughout the UK. or telephone us on (+44) 1793 731225.

Learn more...
Next page(s)...

This page
Blogs

Previous Page(s)...
Forums