ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
12 marks · CSS rules and selectors
The main element of the home page is to have the same CSS styles applied to it as the header element with the exception of the CSS rule to set the height. The height rule should only be applied to the header element. The CSS rule applied to the header element at present is shown below. header { background-color:white; margin-top:20px; margin-bottom:20px; height:90px; } Write the new CSS rules required to style both the header and main elements in the most efficient way. Your answer should include the use of grouping selectors. The Studio Hire web page should include a form for online booking. When using the form, customers will need to submit the following information. • Name • Mobile number • Date required • Session (morning, afternoon or evening) • Additional information (max 400 characters) Using this information, draw a wireframe design for the form on the Studio Hire web page. A form on the Contact Us web page is created using the HTML code shown below. <form> Name: <input type="text" name="name" size="40" required><br><br> Email Address: <input type="text" name="email" size="45" maxlength="5" required><br><br> Age of Child: <input type="radio" name="age" value="<=5" > 5 and under <input type="radio" name="age" value="6-10"> 6 - 10 <input type="radio" name="age" value="11-14"> 11 - 14 <input type="radio" name="age" value="15+" > 15+ <br><br> Class Interested In: <select name="choiceOfClass"> <option value="ballet">Ballet</option> <option value="modern">Modern</option> <option value="tap">Tap</option> </select><br><br> Further comments:<br> <textarea name="comment" rows="5" cols="62" maxlength="500"> </textarea><br><br> How many days per week do you want your child to train? <input type="number" name="days"><br><br> <input type="submit" onclick="alert('Form Entered')" value="Submit"><br><br> </form> State the type of validation used when inputting the ‘Name’. It is important that the website is fully tested and evaluated. Testing should include checking that all input validation works correctly. When testing the form, two errors are found. When entering the number of days per week for training, a user can enter any number. Re-write the code so that the number of days entered is restricted to between 1 and 7 inclusive. There is also an error on the email field. State the change required to the HTML code to ensure that most email addresses can be entered on the form. A dropdown list is used to enter the choice of class. Describe two reasons for using a dropdown list rather than radio buttons on a form. Compatibility testing should also be carried out on the website. State one problem that may be identified when testing compatibility. ScotDance is a dance school which provides classes for children. A website is being created to display information about the dance school and to allow people to contact them, book classes or hire the studio. The home page is shown below. ScotDance Home Classes Studio Hire Contact Us Welcome to ScotDance. We offer children’s dance classes for all ages and levels. Designed By iCreate © 2019
• grouping selector for header, main elements with properties • additional header selector with height property 1 mark for each bullet header, main { background-color:White; margin-top:20px; margin-bottom:20px} Allow margin:20 0 20 0; header { height:90px} header, main selector must be separated with comma • Suitable control for session (radio/list) • Name, Mobile, Date, Additional Information inputs • Validation of any one input from bullet 2 • Submit button 1 mark for each bullet Date picker/calendar/formatted date validates date input Presence check <input type ="number" name ="days" min ="1" max ="7"> Accept min and max without “ ” Change the maxlength to a more appropriate length OR example: maxlength="40" OR Change the maxlength to minlength OR Remove maxlength • Reduced screen area (required for large number of options) • Multiple selections can be made 1 mark for each bullet • Browser/device problems
Previous question: Higher Computing Science 2019 Question 11