Why isn't my html responding? -
my html doesn't show content wrote. objective i'm trying accomplish make button on right "div" make random joke out of 5 spawn on left div. problem don't know how make function make button spawn joke. joke in separate html use replace default 1 in left div when load html. i'm sorry if that's incoherently confusing, thank committing.
this have far:
the primary html:
<html> <head> <title>free jokes!</title> <meta charset="utf-8"> <link href="final project.css" rel="stylesheet"> </head> <body> <h1 id="shadow">welcome free jokes!</h1> <div id="left" src="left.html"/> <div id="right" src="right.html"/> </body> </html>
the left div html:
<!doctype html> <html> <head> <title>free jokes!</title> <script> var randomnumber function clickforjoke() { randomnumber=math.floor( 1 + math.random() * 5); switch ( randomnumber ) { case 1: window.open( "joke1.html", target="right" ); break; case 2: window.open( "joke2.html", target="right" ); break; case 3: window.open( "joke3.html", target="right" ); break; case 4: window.open( "joke4.html", target="right" ); break; case 5: window.open( "joke5.html", target="right" ); break; default: window.open( "joke.html", target="right" );
and external css:
body { background-color: lightblue; } #shadow { text-shadow: -5px -8px 2px lightgreen; font-size: 600%; } left { float:left;width:30%; } right { float:right;width:70%; }
thank in advance!
well, first of all, css selectors wrong. should be:
body { background-color: lightblue; } #shadow { text-shadow: -5px -8px 2px lightgreen; font-size: 600%; } #left { float:left;width:30%; } #right { float:right;width:70%; }
secondly, can't use src
attribute on div
tag. makes no sense!
if you're trying include content page somewhere else, need use iframe
tag. regardless of feelings towards using this, should more like:
<html> <head> <title>free jokes!</title> <meta charset="utf-8"> <link href="final project.css" rel="stylesheet"> </head> <body> <h1 id="shadow">welcome free jokes!</h1> <iframe id="left" src="left.html"></iframe> <iframe id="right" src="right.html"></iframe> </body> </html>
http://www.w3schools.com/tags/tag_iframe.asp
good luck!
Comments
Post a Comment