Coloring links: Difference between revisions

From EdX Copyright Online Course
Jump to navigation Jump to search
(symplified with new version)
(updated instructions)
Line 13: Line 13:


  <a href="http://cyber.law.harvard.edu/"><span style="color:green;">Berkman</span></a>
  <a href="http://cyber.law.harvard.edu/"><span style="color:green;">Berkman</span></a>
Notice that there are
<pre><nowiki>
<span style="color:green;">
</nowiki><pre>
and
<pre><nowiki>
</span>
</nowiki><pre>
HTML elements that wrap the section to which color needs to be applied.  Both parts are necessary as the rendered HTML must be able to tell the browser where the span, and with that the coloring, starts and ends.


==caveats==
==caveats==

Revision as of 22:49, 26 January 2013

This wiki supports css style attributes on links.

The syntax is a little unorthodox but is set using the following:

style attribute

To set the style attribute on a link, enclose the link title within a span with a defined style - in this case specifically, color. e.g.:

[http://cyber.law.harvard.edu/ <span style="color:green;">Berkman</span>]

The above would be converted to the following link:

<a href="http://cyber.law.harvard.edu/">Berkman</a>

Notice that there are

<span style="color:green;">
<pre>

and

<pre>
</span>
<pre>

HTML elements that wrap the section to which color needs to be applied.  Both parts are necessary as the rendered HTML must be able to tell the browser where the span, and with that the coloring, starts and ends.

==caveats==
There are no caveats at the moment.

==examples==
<pre>
[http://www.google.com/ This((.link_red))] is a link in red.
  • This is a link in red.
[http://www.google.com/ This((.link_green))] is a link in green.
  • This is a link in green.
[http://www.google.com/ This((.link_blue))] is a link in blue.
  • This is a link in blue.
[http://www.google.com/ This((.link_yellow))] is a link in yellow.
  • This is a link in yellow.


[http://cyber.law.harvard.edu/cfl/Main_Page This((.link_green))] is a green link.
  • This is a green link.