ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
14 marks · Website structure
Design a multi-level structure for this website. A browser displays the header element of the home page as shown below. Bailey’s Dog Kennels Complete the CSS below to style the header. header{ :lightgrey; padding:0px; } .imageBanner{ :20px; float:left; padding:0px; height:90px; width:130px; } h1{ ; margin-right:30px; margin-top:30px; color:white; display:inline; } The navigational bar shown below makes use of the following CSS. Home Kennels Grooming Gallery Contact Us nav ul{ list-style-type:none; background-color:lightgrey; } nav ul li{ float:left; } nav ul li a{ display:block; color:green; width:100px; text-align:center; padding:14px; } nav li a:hover{ background-color:black; color:white: } Explain why descendant selectors are used here. Describe how the navigational bar changes when the pointer is moved over one of the hyperlinks. The hyperlinks work if the user clicks on or near the text. Identify the line of code that allows this to happen. The home page for Bailey’s Dog Kennels is shown below. Bailey’s Dog Kennels Home Kennels Grooming Gallery Contact Us Why Bailey’s Dog Kennels? At Bailey’s Dog Kennels we treat your dogs as we would treat our own. We provide a friendly yet professional boarding service. © 2009-2019 Bailey’s Dog Kennels | All Rights Reserved When the mouse is placed over the image in the main section, the image changes. Why Bailey’s Dog Kennels? At Bailey’s Dog Kennels we treat your dogs as we would treat our own. We provide a friendly yet professional boarding service. © 2009-2019 Bailey’s Dog Kennels | All Rights Reserved When the mouse is moved away from the image, the image should return to the original one, however, at present this is not happening. HTML code for the home page is shown below. <!DOCTYPE html> <html> <head> <title>Home Page</title> <link rel="stylesheet" type="text/css" href="../CSS/styles.css"> <script> function rollover(my_image){my_image.src = '../images/Bailey2.png';} </script> </head> <body> <header> <h1>Bailey's Dog Kennels</h1> <img class="imageBanner" src="../images/BaileyLogo.png"> </header> <nav> <ul> <li><a href="home.html">Home</a></li> <li><a href="kennels.html">Kennels</a></li> <li><a href="grooming.html">Grooming</a></li> <li><a href="gallery.html">Gallery</a></li> <li><a href="contactUs.html">Contact Us</a></li> </ul> </nav> <main> <h2> <img id="dog1Image" src="../images/Bailey1.png" onmouseover="rollover(this)"> Why Bailey's Dog Kennels?</h2> <p>At Bailey's Dog Kennels we treat your dogs as we would treat our own. We provide a friendly yet professional boarding service.</p> </main> <footer> <h3>© 2009-2019 Bailey's Dog Kennels | All Rights Reserved</h3> </footer> </body> </html> Write the new function to display the original image when the mouse is moved away from the image. Re-write the appropriate HTML element to call the function created in part (i) when the mouse is moved away from the image. Bailey’s Dog Kennels installed an intelligent heating system. Describe one environmental benefit to using a heating system which is intelligent. Bailey’s Dog Kennels is developing a website. The website will have a multi-level structure, consisting of a home page with a horizontal navigational bar that links to four main web pages: Kennels, Grooming, Gallery and Contact Us. The grooming web page will have links to three sub-pages showing costs, treatments and photos.
• 4 main pages in top level • 3 sub-pages from Grooming 1 mark for each bullet • background-color in header selector OR border-color • margin in imageBanner class • float:right in h1 selector 1 mark per bullet header{ background-color/border- color:lightgrey; padding:0px; } .imageBanner{ margin:20px; float:left; padding:0px; height:90px; width:130px } h1{ float:right; margin-right:30px; margin-top:30px; color:white; display:inline; } • style will only apply within the (parent) nav element • style will apply to unordered list/list and/or anchor elements 1 mark for each bullet Exemplification of bullet two is acceptable The background colour changes to black and the text colour changes to white display:block • Appropriate function name with parameter in brackets • Change source attribute of the parameter to Bailey1 image 1 mark for each bullet function mouseaway(my_image) {my_image.src = "../images/Bailey1.png";} Accepts solution using document.getElementByID() Do not penalise { }, ” ”, ; Ensure new function is not named rollover • Add onmouseout event to <img> element • Match function name to name created in part (i) 1 mark for each bullet <img id=’dog1Image’ src = "../images/Bailey1.png" onmouseover="rollover(this)" onmouseout="mouseaway(this)"> Pro-active decision making by software/apps to reduce usage eg • automatically switch heating off/on when within range • monitoring/responding to external weather conditions • adjust heating based on historical patterns of data • zoned heating 1 mark for any one bullet
Previous question: Higher Computing Science 2019 Question 15