0

Primefaces has a fancy HTML editor <p:editor>.
Is there a way to change font-size or apply style in general to the text user enters inside Primefaces' editor? For example, I applied style="" as shown below but it does not work.

<p:editor id="editor" style="font-size: 26px;font-family:verdana" value="#{eventController.eventUI.desc}"/>
4

1 回答 1

1

Primefaces 编辑器使用 iframe,而 iframe 使用内部的一个页面,因此您必须更改该页面的 css。你可以试试:

<h:form id="form">  
        <p:editor id="eid" value="nothing"/>
        <script>
            $(document).ready(function() {
                $('#form\\:eid').find('iframe').contents().find('body').css({
                    'font-size': '10px',
                    'color' : 'blue'
                });
            });
        </script>
    </h:form>
于 2013-06-05T03:08:01.220 回答