Gray background White background Sans-serif text Serif text If the user onclicks
ID: 3533065 • Letter: G
Question
Gray background White background Sans-serif text Serif text If the user onclicks any of the options, the webpage will turn into that format. For example, if the user clicks "Gray backgound", the background color of the webpage will be Gray. If the user clicks Serif-text, the text in the web page will be in Serif text.Gray background White background Sans-serif text Serif text If the user onclicks any of the options, the webpage will turn into that format. For example, if the user clicks "Gray backgound", the background color of the webpage will be Gray. If the user clicks Serif-text, the text in the web page will be in Serif text.
Explanation / Answer
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Solution 12.5</title>
<style type = "text/css">
.option { color: darkblue }
.graybg { background-color: #aaaaaa }
.whitebg { background-color: #ffffff }
.sans { font-family: sans-serif }
.serif { font-family: serif }
</style>
<script type = "text/javascript">
<!--
function bodyClass(color)
{
document.body.classname = color;
}
// -->
</script>
</head>
<body>
<div id = "main">Some sample text.<br /><br />
<div>Options:
<div
class = "color">Gray background</div>
<div
class = "option">White background</div>
<div
class = "option">Sans-serif text</div>
<div
class = "option">Serif text</div>
</div>
</div>
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.