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

24 lines
906 B
Text

<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg4.png); background-size: 489px;">
<div class="dialogue">
Now let's add a paragraph of text below the heading (h1). Perhaps "Welcome to my website" or your favorite quote.
</div>
<div class="dialogue" style="left: 300px; top: 0px">
To make a paragraph, surround your text with the <strong>&lt;p&gt;</strong> tag. So it should look something like
<strong>&lt;p&gt;Hello!&lt;/p&gt;</strong>
</div>
</div>
<script>
function checkHomework() {
var html = editor.getValue()
var match = '<html.+>.+<body>.+<h1>.+</h1>.+<p>.+</p>.+</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/5')
}
}
</script>