htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Applying stylesheet to content


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


scott_sauyet
Novice

Jan 14, 2005, 9:14 AM

Post #1 of 5 (3801 views)
Shortcut
Applying stylesheet to content Can't Post

The htmlarea.css file seems to do well at applying styles to the widgets used in HTMLArea, but I want to apply styles to the content. There are several things I want to do, but one major change would be this:

Code
p { 
margin-top: 0;
margin-bottom: 0;
}

I've seen this as a suggestion on the list, and I've thought of it myself. But it has no effect for me.

I'm using a 3.0 beta version from six or eight months ago. Would a more recent version help? Or is there some better way to do this?

-- Scott


scott_sauyet
Novice

Jan 14, 2005, 12:41 PM

Post #2 of 5 (3784 views)
Shortcut
Re: [scott_sauyet] Applying stylesheet to content [In reply to] Can't Post

Okay, got it. I don't know why I didn't get it before, since I've actually used the technique for other things:


Code
    config.pageStyle="[.. whatever ...] p {margin: 0;}"


I'm going to have to figure out how this works, and why the htmlarea.css rules are not actually applied to the content, but at least I can get it to work.

-- Scott


sleemanj
User

Jan 14, 2005, 6:36 PM

Post #3 of 5 (3770 views)
Shortcut
Re: [scott_sauyet] Applying stylesheet to content [In reply to] Can't Post

The htmlarea.css file is applied to the page containing the editor. The editor itself is a page (iframe) all it's own.


James Sleeman
PHP Programmer


splufdaddy
New User

Jan 14, 2005, 11:48 PM

Post #4 of 5 (3759 views)
Shortcut
Re: [sleemanj] Applying stylesheet to content [In reply to] Can't Post

I'm having problems applying formatting to the content in the editor as well. I want the default font to be Georgia, but I can't find where to specify that. I've gone into the CSS file and put it under a number of properties and it doesn't take effect. I'm using the TableOperations plugin, and I'm unsure how to modify the editor from the page calling the javascript. Here's my code, can anyone help? Thanks a lot!

Code
<script type="text/javascript"> 
// load the plugin files
HTMLArea.loadPlugin("TableOperations");

var editor = null;
function initEditor() {
// create an editor for the textbox
editor = new HTMLArea("WYSIWYG");
// register the TableOperations plugin with our editor

editor.registerPlugin(TableOperations);
editor.pageStyle="body {font-family:Georgia, "Times New Roman", Times, serif;}"
editor.generate();
return false;
}

function insertHTML() {
var html = prompt("Enter some HTML code here");
if (html) {
editor.insertHTML(html);
}
}
function highlight() {
editor.surroundHTML('<span style="background-color: yellow">', '</span>');
}



sleemanj
User

Jan 15, 2005, 8:56 AM

Post #5 of 5 (3736 views)
Shortcut
Re: [splufdaddy] Applying stylesheet to content [In reply to] Can't Post


In Reply To

Code
	editor.pageStyle="body {font-family:Georgia, "Times New Roman", Times, serif;}"



Invalid code there, unescaped quotes inside quotes.

Try


Code
 editor.pageStyle='body {font-family:Georgia, "Times New Roman", Times, serif;}'



James Sleeman
PHP Programmer

 
 
 


Search for (options)