1.
What does CSS stand for?
Correct Answer
C. Cascading Style Sheets
Explanation
CSS stands for Cascading Style Sheets. It is a stylesheet language used for describing the look and formatting of a document written in HTML. CSS allows web designers to separate the content of a webpage from its presentation, making it easier to control the layout, colors, fonts, and other visual aspects of a website. The term "cascading" refers to the way CSS rules can be applied in a hierarchical manner, allowing for a consistent and organized styling across multiple webpages.
2.
What is the correct HTML for referring to an external style sheets
Correct Answer
A. <link rel=stylesheet type=text/css href=mystyle.css>
Explanation
This is the correct HTML for referring to an external style sheet. The element is used to link an external resource to the HTML document, in this case, a style sheet. The "rel" attribute specifies the relationship between the HTML document and the linked resource, in this case, "stylesheet" indicates that the linked resource is a style sheet. The "type" attribute specifies the type of the linked resource, in this case, "text/css" indicates that the linked resource is a CSS file. The "href" attribute specifies the URL or file path of the linked resource, in this case, "mystyle.css" is the file name of the external style sheet.
3.
Where in an HTML document is the correct place to refer to an external style sheet?
Correct Answer
C. In the <head> section
Explanation
The correct place to refer to an external style sheet in an HTML document is in the section. This is where the document's metadata, such as title and character encoding, is typically placed. By linking the external style sheet in the section, it allows the browser to load and apply the styles before rendering the content in the section. This ensures that the styles are applied consistently across the entire document.
4.
Which HTML tag is used to define an internal style sheet?
Correct Answer
C. <style>
Explanation
The tag is used to define an internal style sheet in HTML. This tag is placed within the section of the HTML document and is used to specify the CSS rules for styling the elements within the document. By using the tag, the CSS code can be written directly within the HTML file, making it easier to manage and maintain the styles for the webpage.
5.
Which HTML attribute is used to define inline styles?
Correct Answer
C. Style
Explanation
The HTML attribute used to define inline styles is "style". This attribute allows you to apply specific styles directly to an HTML element, such as setting the font color, background color, or font size. By using the "style" attribute, you can customize the appearance of individual elements without having to create a separate CSS file or use external stylesheets.
6.
Which is the correct CSS syntax?
Correct Answer
A. Body {color: black;}
Explanation
The correct CSS syntax is "body {color: black;}". In CSS, selectors are used to target specific HTML elements, and in this case, the selector "body" is used to target the body element. The curly brackets {} are used to enclose the declaration block, which contains the property "color" and its corresponding value "black". This syntax follows the standard CSS syntax conventions.
7.
Which property is used to change the background color?
Correct Answer
A. Background-color
Explanation
The property used to change the background color is "background-color". This property allows you to specify a color for the background of an element. It can be set to a specific color value or even to transparent. By using this property, you can easily customize the background color of an element to match your design preferences.
8.
How do you add a background color for all <h1> elements?
Correct Answer
A. H1 {background-color:#FFFFFF;}
Explanation
The correct answer is h1 {background-color:#FFFFFF;}. This CSS code targets all <h1> elements and sets the background color to white (#FFFFFF).
9.
Which CSS property is used to change the text color of an element?
Correct Answer
B. Color
Explanation
The CSS property "color" is used to change the text color of an element.
10.
Which CSS property controls the text size?
Correct Answer
A. Font-size
Explanation
The CSS property "font-size" controls the size of the text. It allows you to specify the desired size of the font in pixels, ems, or other units. By using this property, you can make the text appear larger or smaller on the webpage, depending on your requirements.
11.
What is the correct CSS syntax for making all the <p> elements bold?
Correct Answer
B. P {font-weight:bold;}
Explanation
The correct CSS syntax for making all the elements bold is "p {font-weight:bold;}". This CSS rule targets all elements and sets the font-weight property to bold, which makes the text appear in a bold font weight.
12.
Which property is used to change the font of an element?
Correct Answer
B. Font-family
Explanation
The property used to change the font of an element is font-family. This property allows you to specify the typeface or font that should be applied to the text content of the element. By specifying different font families, you can change the appearance of the text to match the desired style or design.
13.
How do you make the text bold?
Correct Answer
B. Font-weight:bold;
Explanation
The correct answer is "font-weight:bold;". This CSS property is used to make the text bold. The "font-weight" property specifies the weight or thickness of the font. By setting it to "bold", the text will appear in a bold font style.
14.
How do you make a list that lists its items with squares?
Correct Answer
C. List-style-type: square;
Explanation
The correct answer is "list-style-type: square;" because this CSS property is used to specify the style of the list item marker. In this case, it sets the marker to be a square shape. The other options, "list: square;" and "list-type: square;", are not valid CSS properties for creating a list with square markers.
15.
How do you select an element with id "demo"?
Correct Answer
C. #demo
Explanation
To select an element with the id "demo", you can use the CSS selector "#demo". The "#" symbol is used to target an element with a specific id, and in this case, it is targeting the element with the id "demo".
16.
How do you display hyperlinks without an underline?
Correct Answer
A. A {text-decoration:none;}
Explanation
The correct answer is "a {text-decoration:none;}". By using this CSS code, the hyperlinks will be displayed without an underline. The "text-decoration" property is used to control the decoration of text, such as underline, overline, or line-through. Setting it to "none" removes any decoration from the text, effectively removing the underline from the hyperlink.
17.
Which property is used to change the left margin of an element?
Correct Answer
A. margin-left
Explanation
The property used to change the left margin of an element is "margin-left". This property allows you to adjust the space between the left edge of the element and its neighboring elements. By specifying a value for "margin-left", you can create space on the left side of the element, pushing it away from other elements.
18.
How do you group selectors?
Correct Answer
C. Separate each selector with a comma
Explanation
To group selectors in CSS, you need to separate each selector with a comma. This allows you to apply the same styles to multiple elements at once. For example, if you want to apply a specific style to all paragraphs and headings, you can group them together by separating the selectors with a comma like this: "p, h1, h2, h3". This way, the defined styles will be applied to all paragraphs and headings in the document.
19.
What is the correct HTML for adding a background color?
Correct Answer
B. <body style="background-color:yellow;">
Explanation
The correct HTML for adding a background color is "". This is because the "style" attribute is used to define the inline CSS properties for an element, and "background-color" is the CSS property that sets the background color of an element. In this case, the background color is set to yellow.
20.
What is the correct HTML for creating a hyperlink?
Correct Answer
A. <a href=longtest2.html>Long Test #2 </a>
Explanation
The correct HTML for creating a hyperlink is "Long Test #2 ". This is because the element is used to create a hyperlink, and the href attribute specifies the URL of the page that the link goes to. The text between the opening and closing tags is the visible text of the link.
21.
Which of these elements are all <table> elements?
Correct Answer
C. <table><tr><td>
Explanation
The elements , , and are all elements. The element is used to create a table, the element represents a row in the table, and the element represents a cell in the table. Therefore, all three elements mentioned in the answer are valid elements.
22.
What is the correct HTML for making a checkbox?
Correct Answer
C. <input type="checkbox">
Explanation
The correct HTML for making a checkbox is . This input element with the type attribute set to "checkbox" creates a checkbox that allows users to select or deselect an option.
23.
What is the correct HTML for making a text input field?
Correct Answer
C. <input type="text">
Explanation
The correct HTML for making a text input field is "". This is because the "" tag is used to create an input field, and the "type" attribute specifies the type of input field, in this case, "text" for a text input field.
24.
What is the correct HTML for making a drop-down list?
Correct Answer
B. <select>
Explanation
The correct HTML for making a drop-down list is . This tag is used to create a drop-down list in HTML.
25.
What is the correct HTML for inserting a background image?
Correct Answer
A. <body style="background-image:url(background.gif)">
Explanation
The correct HTML for inserting a background image is . This code uses the style attribute to set the background image of the body element to "background.gif".
26.
The <____________> tag defines how to divide the window into frames
Correct Answer
C. Frameset
Explanation
The correct answer is "frameset". The frameset tag is used to define how to divide the window into frames. Frames allow for the display of multiple web pages within a single browser window. By using the frameset tag, web developers can specify the layout of these frames, such as their size, position, and arrangement within the window.
27.
With frames, you can display more than one HTML document in the same browser window.
Correct Answer
A. True
Explanation
Frames in HTML allow multiple HTML documents to be displayed within the same browser window. By dividing the window into separate sections or frames, each frame can load and display a different HTML document. This is useful for creating websites with multiple sections or displaying content from different sources simultaneously. Therefore, the correct answer is true.
28.
Each HTML document is called a frame, and each frame is dependent of the others
Correct Answer
A. True
Explanation
Frames in HTML are used to divide a web page into multiple sections, each containing a separate HTML document. These frames are interdependent, meaning that changes in one frame can affect the content displayed in other frames. Therefore, the statement that each HTML document is called a frame and each frame is dependent on the others is true.
29.
Each frameset defines a set of height or width
Correct Answer
B. False
Explanation
Each frameset does not define a set of height or width. Framesets are used to divide a web page into multiple sections, each containing a separate HTML document. The height and width of each frame within a frameset are defined individually using the "rows" and "cols" attributes.
30.
Is this syntax correct?
<html>
<body>
<frameset cols=“30%,40%,30%”>
<frame src = “frame a.html”>
<frame src = “frame b.html”>
<frame src = “frame c.html”>
</frameset>
</html>
Correct Answer
B. False
Explanation
The syntax is correct. The code is using HTML tags to create a frameset with three columns, each containing a frame with a specific source file. The syntax for specifying the source file in the "src" attribute is also correct. Therefore, the correct answer should be "True" rather than "False".
31.
Is this syntax correct?
<html>
<frames rows=“30%,40%,30%”>
<frame src = “frame a.html”>
<frame src = “frame b.html”>
<frame src = “frame c.html”>
</frames>
</html>
Correct Answer
B. False
Explanation
The syntax is correct. The code is using the correct HTML tags for creating frames within a webpage. The "frames" tag is used to define the layout of the frames, and each "frame" tag is used to specify the source file for each frame. Therefore, the correct answer should be True, not False.
32.
The <frameset> element specifies HOW MANY columns or rows there will be in the frameset, and HOW MUCH percentage/pixels of space will occupy each of them.
Correct Answer
A. True
Explanation
The element is used to define the structure of a frameset, which can contain multiple columns or rows. It specifies the number of columns or rows that will be present in the frameset, as well as the percentage or pixel value of space that each column or row will occupy. This allows for the layout of the frameset to be customized according to the desired proportions. Therefore, the given statement that the element specifies how many columns or rows there will be in the frameset, and how much percentage/pixels of space will occupy each of them, is true.
33.
The cols attribute specifies the number and size of rows in a frameset
Correct Answer
B. False
34.
Each <frame> element can hold a separate document.
Correct Answer
A. True
Explanation
The statement is true because in HTML, the element is used to divide a web page into multiple sections, each of which can display a separate document. This allows for the creation of framesets, where each frame can load a different webpage or HTML document. Therefore, each element can indeed hold a separate document.
35.
The attribute row specifies the number and size of rows in a frameset
Correct Answer
A. True
Explanation
The attribute "row" in a frameset specifies the number and size of rows in the frameset. This means that by using the "row" attribute, we can determine how many rows are present in the frameset and also set the size of each row.