Review questions and apply your knowledge

pdf

School

University of the Fraser Valley *

*We aren’t endorsed by this school

Course

145

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

9

Uploaded by MinisterStarHedgehog31

Report
Review Questions Multiple Choice 1. Which of the following is the declaration property used to set the font typeface for an area of a web page? a. face b. font-family (Answer) c. font-face d. size 2. Which of the following is the CSS property used to set the background color of a web page? a. bgcolor b. background-color (Answer) c. color d. none of the above 3. Which of the following describe two components of CSS rules? a. selectors and declarations (Answer) b. properties and declarations c. selectors and attributes d. none of the above 4. Which of the following associates a web page with an external style sheet? a. <style rel="external" href="style.css"> b. <style src="style.css"> c. <link rel="stylesheet" href="style.css"> (Answer) d. <link rel="stylesheet" src="style.css"> 5. Which type of CSS is coded in the body of the web page as an attribute of an HTML tag? a. embedded b. external c. inline (Answer)
d. imported 6. Which of the following do you configure to apply a style to only one area on a web page? a. group b. class c. id (Answer) d. none of the above 7. Which of the following can be a CSS selector? a. an HTML element name b. a class name c. an id name d. all of the above (Answer) 8. Where do you place the code to associate a web page with an external style sheet? a. in the external style sheet b. in the DOCTYPE of the web page document c. in the body section of the web page document d. in the head section of the web page document (Answer) 9. Which of the following configures a background color of #00CED1 for a web page using CSS? a. body { background-color: #00CED1; } (Answer) b. document { background: #00CED1; } c. body { bgcolor: #00CED1;} d. document { bgcolor: #00CED1; } 10. Which of the following uses CSS to configure a class called news with red text, large font, and Arial or a sans-serif font? a. font-family: Arial, sans-serif; } news { color: red; font-size: large;
b. (Answer) c. d. 11. Which of the following is true if a web page contains both a link to an external style sheet and embedded styles? a. Embedded styles will be applied first, and then the external styles will be applied. b. The inline styles will be used. c. External styles will be applied first, and then the embedded styles will be applied. (Answer) d. The web page will not display. .news { color: red; font-size: large; font-family: Arial, sans-serif; } .news { text: red; font-size: large; font-family: Arial, sans-serif; } #news { text: red; font-size: large; font-family: Arial, sans-serif;}
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Fill in the Blank 12. The element is useful for creating areas on a web page that are embedded within paragraphs or other block display elements. (Answer: Span) 13. The CSS property can be used to center text within a block display element. (Answer: text-align) 14. The CSS property can be used to indent the first line of text. (Answer: text-indent) 15. The CSS property can be used to configure bold text. 16. (Answer: font-style)
Apply Your Knowledge 1. PREDICT THE RESULT. Draw and write a brief description of the web page that will be created with the following HTML code: <!DOCTYPE html> <html lang="en"> <head> <title>Trillium Media Design</title> <meta charset="utf-8"> <style> body { background-color: #000066; color: #CCCCCC; font-family: Arial,sans-serif; } header { background-color: #FFFFFF; color: #000066; } footer { font-size: 80%; font-style: italic; } </style> </head> <body> <header><h1>Trillium Media Design</h1></header> <nav>Home <a href="about.html">About</a> <a href="services.html"> Services</a> </nav> <p>Our professional staff takes pride in its working relationship with our clients by offering personalized services that listen to their needs, develop their target areas, and incorporate these items into a website that works.</p> <br><br> <footer> Copyright &copy; 2020 Trillium Media Design </footer> </body> </html> (Answer)
2. FILL IN THE MISSING CODE. The web page corresponding to the following code should be configured so that the background and text colors have good contrast. The header area should use Arial font. Consider the following code, in which some CSS properties and values, indicated by "_" , and some HTML tags, indicated by <_> , are missing. Fill in the missing code.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
<!DOCTYPE html> <html lang="en"> <head> <title>Trillium Media Design</title> <meta charset="utf-8"> <style> body { background-color: #0066CC; color: "_"; } header { "_": "_" } <_> <_> <body> <header><h1>Trillium Media Design</h1></header> <p>Our professional staff takes pride in its working relationship with our clients by offering personalized services that listen to their needs, develop their target areas, and incorporate these items into a website that works. </p> </body> </html> (Answer) <!DOCTYPE html> <html lang="en"> <head> <title>Trillium Media Design</title> <meta charset="utf-8"> <style> body { background-color: #0066CC; color:white; }
header { background-color:white; color: #0066CC; } </style> </head> <body> <header><h1>Trillium Media Design</h1></header> <p>Our professional staff takes pride in its working relationship with our clients by offering personalized services that listen to their needs, develop their target areas, and incorporate these items into a website that works. </p> </body> </html>
3. FIND THE ERROR. Why won’t the page corresponding to the following code display properly in a browser? <!DOCTYPE html> <html lang="en"> <head> <title>Trillium Media Design</title> <meta charset="utf-8"> <style> body { background-color: #000066; color: #CCCCCC; font-family: Arial,sans-serif; font-size: 1.2em; } <style> </head> <body> <header><h1>Trillium Media Design</h1></header> <main><p>Our professional staff takes pride in its working relationship with our clients by offering personalized services that listen to their needs, develop their target areas, and incorporate these items into a website that works. </p></main> </body> </html> (Answer) Because there is no closing tag for style tag. So, we have to add “/” before the 2 nd <style> tag to make it a closing tag.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help