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. Creative Style Sheets
C. Colorful Style Sheets
D. Computer Style Sheets

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

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

3 Which HTML attribute is used to define inline styles?

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

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

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

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. background-color
B. bgcolor
C. background-style
D. color

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

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

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

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

10 Which CSS property controls the text size?

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

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

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

12 How do you display hyperlinks without an underline?

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

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

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

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

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

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. Margin
B. Padding
C. Border
D. Content

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

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

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

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

21 How do you specify a background image?

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

22 How do you prevent a background image from repeating?

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

23 Which CSS property specifies the alignment of text?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

A. table:striped {background-color: #f2f2f2;}
B. tr:zebra {background-color: #f2f2f2;}
C. tr:odd-even {background-color: #f2f2f2;}
D. tr:nth-child(even) {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[type='text']
D. input.text

33 Which property specifies the stack order of an element?

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

34 Which CSS property is used to italicize text?

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

35 Which of the following has the highest priority?

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

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

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

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

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

38 Which property specifies the width of a table border?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

A. cell-padding
B. border-collapse
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: hand;
B. mouse: pointer;
C. pointer: hand;
D. cursor: pointer;

47 What is the default positioning of HTML elements?

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

48 Which property specifies the transparency of an element?

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

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

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

50 Which property adds a shadow to text?

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