neocities/views/tutorial/html/8.erb
2015-12-14 14:55:33 -08:00

37 lines
1.1 KiB
Text

<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg8.png); background-size: 489px;">
<div class="dialogue">
Now add a link to one of your list items. If nested properly, it should look something like this:
<br><strong>&lt;li&gt;&lt;a href="http://yarn.com"&gt;Yarn&lt;/a&gt;&lt;/li&gt;</strong>
</div>
</div>
<div class="welcome">
<h4>Tags so far</h4>
<p>Headings: <h1>Title of the page!</h1>
<h2>Less important title</h2></p>
<p>Paragraphs: <p>Hello!</p></p>
<p>Links: <a href="http://wikipedia.org">Click here!</a></p>
<p>Images: <img src="hello.png"></p>
<p>Lists</p>
</div>
<script>
function checkHomework() {
var html = editor.getValue()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html.+>.+<body>.+<ul>.+<li><a.+href=".+">.+</a></li>.+</ul>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {
notok("That's not right! Try again.")
} else {
sessionStorage.setItem('tutorialHtml', html)
ok('Great, you did it!', '/tutorial/html/9')
}
}
</script>