0% found this document useful (0 votes)
2 views

Practice Problems ( Code Fast)

The document contains a practice test with HTML and JavaScript examples, including creating ordered and unordered lists, a login form, and using internal CSS. It also includes a set of viva questions related to HTML and CSS concepts, such as the purpose of tags, attributes, and styling rules. Additionally, it addresses JavaScript object creation and logging properties to the console.

Uploaded by

daydreamer200105
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Practice Problems ( Code Fast)

The document contains a practice test with HTML and JavaScript examples, including creating ordered and unordered lists, a login form, and using internal CSS. It also includes a set of viva questions related to HTML and CSS concepts, such as the purpose of tags, attributes, and styling rules. Additionally, it addresses JavaScript object creation and logging properties to the console.

Uploaded by

daydreamer200105
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CIA-3

PRACTICE TEST

1.Create an HTML document that includes both an ordered list and an unordered list.

Html….?

<html >
<head> <title>Lists Example</title> </head>
<body>
<h1>My Favorite Fruits</h1>
<h2>Ordered List</h2>
<ol>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
</ol>
<h2>Unordered List</h2>
<ul>
<li>Orange</li>
<li>Grapes</li>
<li>Mango</li>
</ul>
</body>
</html>
2.Create a simple HTML login form that resembles a Facebook login page….?

<html>

<head>

<title>Facebook Login</title>

</head>

<body>

<h1>Facebook</h1>

<form>
<label for="email">Email or Phone:</label><br>

<input type="text" id="email" name="email" ><br><br>

<label for="password">Password:</label><br>

<input type="password" id="password" name="password" ><br><br>

<input type="submit">

</form>

</body>

</html>

3.Create an HTML document that uses internal CSS to style the page….?

<html>

<head>

<title>Internal CSS Example</title>

<style>

body {background-color: #f0f0f0;

font-family: Arial, sans-serif;}

h1 {color: #333;}

p {color: #666;}

</style>

</head>

<body>

<h1>Welcome to My Page</h1>

<p>This is a simple example of using internal CSS. </p>

</body>

</html>

4.Create a simple JavaScript object that represents a person and log the properties to the
console….?

let person = {

name: "kohli",

age: 36,

isStudent: false
};

let person1 = {

name: "dhoni",

age:42,

isStudent: false

};

console.log(person.name); // Output: kolhi

console.log(person1.name); // Output: 30
VIVA QUESTIONS

1. What does HTML stand for?

• HyperText Markup Language

2. What is the purpose of the <head> tag in HTML?

• Contains meta-information about the document, such as title and links to


stylesheets.

3. What is the correct HTML element for inserting a line break?

• <br>

4. How do you create a hyperlink in HTML?

• Using the <a> tag, e.g., <a href="url">Link Text</a>

5. What is the purpose of the <div> tag?

• To create a block-level container for grouping elements.

6. How do you create an unordered list in HTML?

• Using the <ul> tag with <li> items, e.g., <ul><li>Item 1</li></ul>

7. What is the difference between <strong> and <b> tags?

• <strong> indicates strong importance (semantic), while <b> is just for bold text
(stylistic).

8. What attribute is used to specify the destination of a link?

• href

9. How do you add an image in HTML?

• Using the <img> tag, e.g., <img src="image.jpg" alt="Description">

10. What is the purpose of the <form> tag?

• To create an interactive form for user input.

CSS Questions

11. What does CSS stand for?

• Cascading Style Sheets

12. How do you apply an external CSS file to an HTML document?

• Using the <link> tag in the <head>, e.g., <link rel="stylesheet" href="styles.css">

13. What is the syntax for a CSS rule?

• Selector { property: value; }

14. How do you select an element with a specific class in CSS?

• Using a dot before the class name, e.g., .classname { }


15. What is the difference between margin and padding?

• margin is the space outside an element, while padding is the space inside an
element.

16. How do you change the text color in CSS?

• Using the color property, e.g., color: red;

17. What is the purpose of the display property in CSS?

• To define how an element is displayed on the page (e.g., block, inline).

18. How do you create a CSS comment?

• Using /* comment */

19. What is a CSS selector?

• A pattern used to select the elements you want to style.

20. How do you center a block element horizontally in CSS?

• Set margin: auto; and define a width for the element.

You might also like