0

当我将 CKEditor 4.0 与没有任何样式或样式表关联的 HTML 页面结合时,编辑器在显示项目符号和数字时看起来很好。

但是,当我应用模板的样式表/CSS 时,集成的 CKEditor 组件开始无法正确显示项目符号和数字。我的意思是它显示了站点的样式表的项目符号,这完全不是为该上下文指定的。例如,项目符号在每个文本条目的右侧显示为一个小图片。或者没有显示 1、2、3 等。

如何使 CKEditor 不使用站点的样式表,而是使用它自己的样式表。代码片段如下所示:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>FAQ</title>
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="~/Content/themes/construct/stylesheets/style.css"> 
<link rel="stylesheet" href="~/Content/themes/construct/stylesheets/responsive.css"> 
<script src="~/Content/themes/construct/scripts/jquery.min.js"></script> 
<script src="~/Content/themes/construct/scripts/jquery.simpleFAQ-0.7.min.js"></script>  
<script src="~/Content/themes/construct/scripts/js_func.js"></script>
<script src="~/ckeditor/ckeditor.js"></script>

<script>
    $(function () {
        $('#faq').simpleFAQ();
    });
</script>

</head>
<body>
<div class="wraper">
 <header class="header">
 </header>
</div> 

 <!-- /top_title -->
 <!-- /faq_list -->
 <div class="faq_list">
  <ul class="filter">
   <li class="active all"><a href="#all">All</a></li>
   <li class="business"><a href="#business">Business</a></li>
   <li class="technical"><a href="#technical">Technical</a></li>
   <li class="miscellaneous"><a href="#miscellaneous">Miscellaneous</a></li>
  </ul>
  <ul id="faq">
    @foreach (var entry in Model.MyList)
    {
    <li class="all business">
        <p class="question">
            @entry.Question
        </p>
        @foreach (var newEntry in entry.List2)
        {            
            <div class="answer" id="editable" contenteditable="true">
                <h1>@newEntry.Header</h1>
                <p>@newEntry.Answer</p>
            </div>

            }
    </li>
        }
  </ul>
 </div>
 </body>
 </html>

谢谢您的帮助。皮疹

4

1 回答 1

0

覆盖样式表的最佳方法是..

  1. 将相同的类复制到一个新文件中,并将该文件链接到默认站点之后。前任。默认:

    .class1 {字体:正常 12px Arial;}

覆盖

.class1 {font: bold 12px Arial;}

2..按照前面的流程,将属性标记为!important。前任..

默认:

.class1 {font: normal 12px Arial;padding:10px;}

覆盖:

.class1 {font: normal 12px Arial;padding-left:10px !important;}
于 2013-03-08T05:51:16.643 回答