<div> formatting problem

Last post 04-04-2007, 6:23 AM by Adam. 4 replies.
Sort Posts: Previous Next
  •  01-10-2007, 8:17 AM 25684

    <div> formatting problem

    I am experiencing the following problem:
     
    Because the editor wraps the content into a <div>content</div> element I've added the following lines to the stylesheet:
     
    div {
     margin-bottom: 20px;
    }
     
    thinking this would lead to the 20 pixel space below every DIV-Container.
     
    But even though it displays correctly in my Website it is ignored by the editor in both Normal- and Preview-Mode.
    I've been searching the forum but could not find a similar entry. Is there a problem that I don't know about or am I doing something wrong?
     
    Thanks for your help in advance,
    edi
  •  01-10-2007, 10:16 AM 25689 in reply to 25684

    Re: <div> formatting problem

    edi,
     
    Please use Editor.EditorWysiwygModeCss Property to specify the location of the style sheet that will be used by the editable area. Multiple Style Sheets are supported. Find  the location of containing style sheet, and append it to EditorWysiwygModeCss property as followings:

    Example EditorWysiwygModeCss="example.css,~/yourparentpage.css"

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-10-2007, 11:25 AM 25696 in reply to 25689

    Re: <div> formatting problem

    what if you setting these styles through code dynamically and can't put them in a css file?  Right now I am putting styles within a script block of the html that the editor is displaying. 
     
    Example:
    string strStyle = "<script type="text/css"> .page{background-color:Blue;}</script>";
    string strHTML = "<html><head>" + strStyle + "</head><body class='page'>test.....</body></html>";
    Editor1.Text = strHTML;
     
    In this example style do not display in the Normal or Preview mode.  Is there some way to get the Editor to use these styles?  This worked in a previous version.  If there is no workaround are there any earlier version that support asp.net 2.0 where this is not broken?
  •  04-04-2007, 5:47 AM 27984 in reply to 25689

    Re: <div> formatting problem

    adam,
     
    i tried your example and when I look up the sourcecode it looks like this in my HTML code:
    EditorWysiwygModeCss="/system/rienzbraeuit/styles/style.css,~/system/rienzbraeuit/styles/body.css"
     
    But still the styles from my body.css are not applied to the editor content. 
     
    For Example:
    In my body.css is the following class:

    div {
     margin-bottom: 15px;
    }
     
    but when I press the ENTER button and a <div> </div> is generated there is no 15px space underneath it.
     
    Can you help?
  •  04-04-2007, 6:23 AM 27986 in reply to 27984

    Re: <div> formatting problem

    edgarJakob,
     
    Please try the steps below.
     
    1. Create a new empty style sheet and copy the following code into it:
     
    div {
     margin-bottom: 15px;
    }
     
     
    2. Rename this file to mybody2.css
     
    3. Then let Cute Editor uses it:
     
    EditorWysiwygModeCss="/system/rienzbraeuit/styles/style/mybody2.css"
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML