Skip to content

Commit c8b8caa

Browse files
committed
Improved content styles. Updated replacebycode sample contents.
* Added block container style. * Added compact table style for content. * Updated image styles.
1 parent c502643 commit c8b8caa

File tree

3 files changed

+59
-16
lines changed

3 files changed

+59
-16
lines changed

contents.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ body
1616
background-color: #fff;
1717

1818
margin: 20px;
19+
line-height: 1.6em;
1920
}
2021

2122
blockquote
2223
{
2324
font-style: italic;
24-
padding: 8px 8px 8px 20px;
25+
padding: 2px 8px 2px 20px;
2526
border-left: 5px solid #ccc;
27+
font-family: Georgia, Times, "Times New Roman", serif;
2628
}
2729

2830
a
@@ -41,9 +43,20 @@ ol,ul,dl
4143
h1,h2,h3,h4,h5,h6
4244
{
4345
font-weight: normal;
46+
line-height: 1.2em;
4447
}
4548

4649
p,ul,ol,dl,blockquote
4750
{
48-
line-height: 1.6em;
51+
}
52+
53+
hr
54+
{
55+
border: 0px;
56+
border-top: 1px solid #ccc;
57+
}
58+
59+
img:hover {
60+
opacity: .9;
61+
filter: alpha(opacity = 90);
4962
}

samples/replacebycode.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ <h1 class="samples">
2424
</pre>
2525
</div>
2626
<textarea cols="80" id="editor1" name="editor1" rows="10">
27-
<h1>
28-
<img alt="Saturn V carrying Apollo 11" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Apollo_11_Launch2.jpg/160px-Apollo_11_Launch2.jpg" style="border: 1px solid rgb(204, 204, 204); margin-left: 10px; padding: 5px; float: right; width: 120px; height: 150px;" />
29-
Apollo 11
30-
</h1>
27+
<h1><img alt="Saturn V carrying Apollo 11" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Apollo_11_Launch2.jpg/160px-Apollo_11_Launch2.jpg" style="border:1px solid #ccc;float:right;margin-left:15px;padding:5px;" /> Apollo 11</h1>
3128

3229
<p><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>
3330

@@ -37,11 +34,11 @@ <h2>Broadcasting and <em>quotes</em> <a id="quotes" name="quotes"></a></h2>
3734

3835
<p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p>
3936

40-
<blockquote>One small step for [a] man, one giant leap for mankind.</blockquote>
37+
<blockquote><p>One small step for [a] man, one giant leap for mankind.</p></blockquote>
4138

4239
<p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p>
4340

44-
<blockquote>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</blockquote>
41+
<blockquote><p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p></blockquote>
4542

4643
<h2>Technical details <a id="tech-details" name="tech-details"></a></h2>
4744

@@ -79,6 +76,8 @@ <h2>Technical details <a id="tech-details" name="tech-details"></a></h2>
7976

8077
<p>After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis" title="Mare Tranquillitatis">Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean">Pacific Ocean</a> on July 24.</p>
8178

79+
<hr />
80+
<p style="text-align: right;"><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small></p>
8281
</textarea>
8382
<script>
8483

@@ -88,6 +87,7 @@ <h2>Technical details <a id="tech-details" name="tech-details"></a></h2>
8887

8988
// Replace the <textarea id="editor"> with an CKEditor
9089
// instance, using default configurations.
90+
9191
CKEDITOR.replace( 'editor1' );
9292

9393
</script>

styles.js

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,18 @@ CKEDITOR.stylesSet.add( 'default', [
3131
{ name: 'Address', element: 'address' },
3232
*/
3333

34-
{ name: 'Blue Title', element: 'h3', styles: { 'color': 'Blue' } },
35-
{ name: 'Red Title', element: 'h3', styles: { 'color': 'Red' } },
34+
{ name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
35+
{ name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
36+
{
37+
name: 'Block container',
38+
element: 'div',
39+
styles: {
40+
padding: '10px',
41+
background: '#eee',
42+
border: '1px solid #ccc',
43+
'margin-bottom': '10px'
44+
}
45+
},
3646

3747
/* Inline Styles */
3848

@@ -72,22 +82,42 @@ CKEDITOR.stylesSet.add( 'default', [
7282
/* Object Styles */
7383

7484
{
75-
name: 'Image on Left',
85+
name: 'Styled image (left)',
7686
element: 'img',
7787
attributes: {
78-
'style': 'padding: 5px; margin-right: 5px',
79-
'border': '2',
8088
'align': 'left'
89+
},
90+
styles: {
91+
padding: '5px',
92+
'margin-right': '10px',
93+
border: '1px solid #ccc'
8194
}
8295
},
8396

8497
{
85-
name: 'Image on Right',
98+
name: 'Styled image (right)',
8699
element: 'img',
87100
attributes: {
88-
'style': 'padding: 5px; margin-left: 5px',
89-
'border': '2',
90101
'align': 'right'
102+
},
103+
styles: {
104+
padding: '5px',
105+
'margin-left': '10px',
106+
border: '1px solid #ccc'
107+
}
108+
},
109+
110+
{
111+
name: 'Compact table',
112+
element: 'table',
113+
attributes: {
114+
cellpadding: '5',
115+
cellspacing: '0',
116+
border: '1',
117+
bordercolor: '#ccc'
118+
},
119+
styles: {
120+
'border-collapse': 'collapse'
91121
}
92122
},
93123

0 commit comments

Comments
 (0)