1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-06 01:56:20 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/wikitextrules/StyleBlockWikiText.tid

44 lines
923 B
Plaintext
Raw Normal View History

2012-06-14 17:18:32 +00:00
title: StyleBlockWikiText
This syntax enables you to assign arbitrary styles to generated elements. For example:
{{{
@@color:#f00;
@@text-decoration:underline;
2012-06-14 17:18:32 +00:00
This is in red!
@@
}}}
Generates the results:
@@color:#f00;
@@text-decoration:underline;
2012-06-14 17:18:32 +00:00
This is in red!
@@
The HTML looks like this:
{{{
2012-06-14 18:01:06 +00:00
<p style="color:rgb(255, 0, 0); text-decoration:underline;">This is in red!</p>
2012-06-14 17:18:32 +00:00
}}}
Note that the style block doesn't generate any HTML elements itself, but instead causes the styles to be applied to all of the elements contained within the style block. This means that you can assign styles to elements generated from WikiText. For example, here is a list with some additional styles applied:
{{{
@@background-color:#00f;
* First item
* Second item
* Third item
@@
}}}
The generated HTML is:
{{{
<ul style="background-color: rgb(0, 0, 255);">
<li>First item</li>
<li>Second item</li>
<li>Third item</li></ul>
}}}