0% found this document useful (0 votes)
6 views3 pages

WS Ass2

The document contains a series of questions and answers related to CSS and HTML, focusing on styling elements and proper syntax. It includes examples of code snippets and asks for the correct interpretations of font colors, sizes, and the use of external stylesheets. Additionally, it provides tasks for writing XHTML code with specified CSS styles both externally and inline.

Uploaded by

ariraghad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

WS Ass2

The document contains a series of questions and answers related to CSS and HTML, focusing on styling elements and proper syntax. It includes examples of code snippets and asks for the correct interpretations of font colors, sizes, and the use of external stylesheets. Additionally, it provides tasks for writing XHTML code with specified CSS styles both externally and inline.

Uploaded by

ariraghad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Web Systems- Assignment2

Telegram : @programming_1_2
Q1. Given the following CSS code, what would be the font color for H1 and H3?
h1, h2, h3 {font-family: Verdana; color: red}
h1, h3 {font-weight: bold; color: pink}
(a) h1 = red, h3 = red.
(b) h1 = pink, h3 = pink.

Q2. Given the following HTML code segment:


<h3> Line 1 </h3>
<h3> <em> Line 2 </em> </h3>
What would be the font color for both "Line 1" and "Line 2" using the CSS code:
h3 > em {font-weight: bold; color: green}
(a) Line 1 = black.
(b) Line 2 = green.

Q3. Given the following HTML code segment:


<b> Item1 </b> <i> Item2</i>
<p> <i> Item3</i> <b> Item4</b> </p>
What would be the font size and color of "Item1", "Item2", "Item4", and "Item4"
using the CSS code:
b + i {font-size: 20pt; color: red}
(3.1) Item1 = Item2 = Item3 = Item4 = color = black.
(3.2) Item1 = Item3 = Item4 = font size = Default.
Item2 = font-size = 20pt.

Q4. Choose the correct answer.


1. 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">
2. Where in an HTML document is the correct place to refer to an external
style sheet?
a. In the <body> section
b. In the <head> section
c. At the end of the document
3. Which HTML attribute is used to define inline styles?
a. Style b. Class c. Non oh the previous
4. Which is the correct CSS syntax?
a. body:color=black; b. {body:color=black;}
c. {body;color:black;} d. body {color: black;}
5. How do you select an element with id "demo"?
a. #demo b. *demo c. !demo d. /demo

Q5. Write a full xhtml code using CSS with the following specifications.

Page title Assignment 2 – Question 5.

CSS type/ Name External. Name of CSS file is "Q5.css".

Page Contents/ This is line 1 / use h1/ red color/ Verdana font size 20.
specifications This is line 2 / use h2/ default browser.

Page background Yellow color

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"


"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="Q5.css" media="all" />
<head>
<title>Assignment 2 - Question 5.</title>
</head>
<body>
<h1>This is line 1</h1>
<h2>This is line 2</h2>
</body>
</html>
h1 {
color: red;
font-size: 20;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
body {
background-color: yellow;
}

Q6. Re-answer the previous question with the same specifications above using
embedded and inline CSS styles.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Assignment 2 - Question 5.</title>
</head>
<body style="background-color: yellow;">
<h1 style="color: red; font-size: 20; font-family:Verdana, Geneva, Tahoma,
sans-serif">This is line 1</h1>
<h2>This is line 2</h2>
</body>
</html>

You might also like