Unit 3 - Practice Quiz

CSE326 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What does CSS stand for?

A. Cascading Style Sheets
B. Computer Style Sheets
C. Colorful Style Sheets
D. Creative Style Sheets

2 Which HTML tag is used to define an internal style sheet?

A. <link>
B. <script>
C. <css>
D. <style>

3 Which HTML attribute is used to define inline styles?

A. style
B. font
C. class
D. styles

4 What is the correct HTML for referring to an external style sheet?

A. <stylesheet>mystyle.css</stylesheet>
B. <link rel="stylesheet" type="text/css" href="mystyle.css">
C. <style src="mystyle.css">
D. <a href="mystyle.css">

5 Which is the correct CSS syntax?

A. body {color: black;}
B. body = color: black;
C. body:color=black;
D. {body;color:black;}

6 How do you insert a comment in a CSS file?

A. // this is a comment
B. / this is a comment /
C. <!-- this is a comment -->
D. ' this is a comment

7 Which CSS property is used to change the background color?

A. bgcolor
B. background-style
C. background-color
D. color

8 How do you add a background color for all <h1> elements?

A. h1.all {background-color:#FFFFFF;}
B. h1 {background-color:#FFFFFF;}
C. all.h1 {background-color:#FFFFFF;}
D. #h1 {background-color:#FFFFFF;}

9 Which CSS property is used to change the text color of an element?

A. fgcolor
B. text-color
C. font-color
D. color

10 Which CSS property controls the text size?

A. font-size
B. text-size
C. font-style
D. text-style

11 What is the correct CSS syntax for making all the <p> elements bold?

A. p {text:bold;}
B. p {style:bold;}
C. p {font-weight:bold;}
D. p {text-size:bold;}

12 How do you display hyperlinks without an underline?

A. a {underline:none;}
B. a {text-style:no-underline;}
C. a {text-decoration:none;}
D. a {decoration:no-underline;}

13 How do you make each word in a text start with a capital letter?

A. text-style:capitalize
B. text-transform:capitalize
C. transform:capitalize
D. font-transform:capitalize

14 Which property is used to change the font of an element?

A. font-weight
B. font-style
C. font-typeface
D. font-family

15 How do you select an element with id 'demo'?

A. demo
B. *demo
C. #demo
D. .demo

16 How do you select elements with class name 'test'?

A. test
B. .test
C. *test
D. #test

17 How do you select all p elements inside a div element?

A. div.p
B. div + p
C. div p
D. div, p

18 In the CSS Box Model, what is the innermost component?

A. Content
B. Padding
C. Margin
D. Border

19 Which property is used to generate space around an element's content, inside of any defined borders?

A. spacing
B. padding
C. margin
D. border

20 Which property is used to generate space outside the border?

A. padding
B. border-spacing
C. outline
D. margin

21 How do you specify a background image?

A. img-background: url('image.jpg')
B. background-image: url('image.jpg')
C. background-img: url('image.jpg')
D. background-source: 'image.jpg'

22 How do you prevent a background image from repeating?

A. background-repeat: never;
B. background-repeat: no-repeat;
C. background: unique;
D. background-repetition: none;

23 Which CSS property specifies the alignment of text?

A. text-position
B. text-align
C. font-align
D. text-justify

24 What is the correct CSS shorthand for setting a border?

A. border-width: 1px solid black;
B. border: solid black 1px;
C. border-style: 1px black solid;
D. border: 1px solid black;

25 Which property is used to set the height of a line of text?

A. text-height
B. line-height
C. font-height
D. spacing-height

26 What is the difference between 'div' and 'span'?

A. div is block, span is inline
B. div is inline, span is block
C. Both are block elements
D. Both are inline elements

27 Which CSS property collapses table borders into a single border?

A. border-style: collapse;
B. border-spacing: 0;
C. border-collapse: collapse;
D. table-border: single;

28 How do you group multiple selectors to share the same styles?

A. Separate them with a space
B. Separate them with a comma
C. Separate them with a plus sign
D. Separate them with a semicolon

29 If 'margin: 10px 20px 30px 40px;' is set, what is the left margin?

A. 40px
B. 20px
C. 10px
D. 30px

30 Which pseudo-class is used to define a special state of an element when the user moves the mouse over it?

A. :active
B. :visited
C. :focus
D. :hover

31 How do you create a 'zebra-striped' table using CSS?

A. tr:odd-even {background-color: #f2f2f2;}
B. tr:nth-child(even) {background-color: #f2f2f2;}
C. tr:zebra {background-color: #f2f2f2;}
D. table:striped {background-color: #f2f2f2;}

32 Which selector is used to select input fields with a specific type attribute?

A. input#text
B. input:text
C. input.text
D. input[type='text']

33 Which property specifies the stack order of an element?

A. s-index
B. z-index
C. x-index
D. d-index

34 Which CSS property is used to italicize text?

A. font-variant
B. font-weight
C. font-style
D. text-style

35 Which of the following has the highest priority?

A. Internal CSS
B. Inline CSS
C. External CSS
D. Browser default

36 What value of the 'display' property makes an element completely disappear without occupying space?

A. invisible
B. hidden
C. none
D. block

37 How can you center-align a block element (like a div) horizontally?

A. float: center;
B. margin-left: auto; margin-right: auto;
C. text-align: center;
D. align: center;

38 Which property specifies the width of a table border?

A. width
B. border-width
C. border-size
D. table-border

39 Which pseudo-class is commonly used to style an input field when it is clicked on or selected via tab?

A. :active
B. :selected
C. :hover
D. :focus

40 How do you make a list not display bullet points?

A. text-decoration: none;
B. bullet-style: none;
C. list-style-type: none;
D. list: none;

41 What is the purpose of the Universal Selector (*) in CSS?

A. Selects all elements with a specific ID
B. Selects all elements on the page
C. Selects the first element
D. Selects all elements inside a div

42 Which CSS unit is relative to the font-size of the root element?

A. em
B. %
C. px
D. rem

43 Which property allows you to set the position of a background image?

A. background-origin
B. background-position
C. background-location
D. background-align

44 How can you specify that a text area in a form should not be resizable?

A. resize: none;
B. max-width: 100%;
C. size: fixed;
D. fixed: true;

45 Which property controls the space between the borders of adjacent table cells?

A. border-collapse
B. cell-padding
C. cell-spacing
D. border-spacing

46 How do you change the cursor to a pointer/hand when hovering over a submit button?

A. cursor: pointer;
B. cursor: hand;
C. pointer: hand;
D. mouse: pointer;

47 What is the default positioning of HTML elements?

A. fixed
B. absolute
C. relative
D. static

48 Which property specifies the transparency of an element?

A. transparent
B. filter
C. opacity
D. visibility

49 Which CSS selector selects all elements with the class 'intro' inside a div?

A. div .intro
B. div.intro
C. div #intro
D. .intro div

50 Which property adds a shadow to text?

A. text-effect
B. shadow-text
C. font-shadow
D. text-shadow