codebypc
2.09K subscribers
210 photos
59 videos
160 files
250 links
Html, css3, javascript, reactjs, express, Fullstack, backend, Bootstrap, mongodb
Download Telegram
Here are 10 multiple-choice questions (MCQs) on CSS:

### 1. Which of the following is the correct syntax for referring to an external style sheet?
- A) <link src="styles.css" rel="stylesheet">
- B) <style src="styles.css">
- C) <link rel="stylesheet" href="styles.css">
- D) <style rel="stylesheet" src="styles.css">

Answer: C) <link rel="stylesheet" href="styles.css">

### 2. What is the correct syntax for applying a class selector to an element in CSS?
- A) #class {color: red;}
- B) .class {color: red;}
- C) class {color: red;}
- D) *class {color: red;}

Answer: B) .class {color: red;}

### 3. Which CSS property is used to change the background color of an element?
- A) color
- B) bgcolor
- C) background-color
- D) background-image

Answer: C) background-color

### 4. How do you make each word in a text start with a capital letter using CSS?
- A) text-transform: capitalize;
- B) text-transform: uppercase;
- C) text-decoration: capitalize;
- D) font-style: capitalize;

Answer: A) text-transform: capitalize;

### 5. Which of the following properties is used to change the font of an element?
- A) font-family
- B) font-style
- C) font-weight
- D) font-variant

Answer: A) font-family

### 6. What is the default value of the position property in CSS?
- A) relative
- B) absolute
- C) static
- D) fixed

Answer: C) static

### 7. Which of the following units is relative to the font-size of the element?
- A) px
- B) em
- C) %
- D) cm

Answer: B) em

### 8. How do you select an element with the ID "header" in CSS?
- A) #header { }
- B) .header { }
- C) header { }
- D) *header { }

Answer: A) #header { }

### 9. Which property is used to change the text color of an element?
- A) font-color
- B) text-color
- C) color
- D) font-style

Answer: C) color

### 10. How do you create space between the border and the content of an element?
- A) margin
- B) padding
- C) spacing
- D) border-spacing

Answer: B) padding
👍2
Here are 20 HTML multiple-choice questions (MCQs) with their answers:

### 1. What does HTML stand for?
- a) Hyper Text Markup Language
- b) Home Tool Markup Language
- c) Hyperlinks and Text Markup Language
- Answer: a) Hyper Text Markup Language

### 2. Which HTML tag is used to define an internal style sheet?
- a) <css>
- b) <script>
- c) <style>
- d) <link>
- Answer: c) <style>

### 3. Which HTML attribute is used to define inline styles?
- a) style
- b) class
- c) font
- d) styles
- Answer: a) style

### 4. Which is the correct HTML element for inserting a line break?
- a) <br>
- b) <break>
- c) <lb>
- d) <hr>
- Answer: a) <br>

### 5. Which HTML element is used to define the title of a document?
- a) <meta>
- b) <head>
- c) <title>
- d) <header>
- Answer: c) <title>

### 6. How can you make a numbered list?
- a) <ul>
- b) <ol>
- c) <dl>
- d) <list>
- Answer: b) <ol>

### 7. Which HTML element is used to create a hyperlink?
- a) <a>
- b) <link>
- c) <href>
- d) <hyperlink>
- Answer: a) <a>

### 8. Which attribute is used to specify that an input field must be filled out?
- a) required
- b) placeholder
- c) validate
- d) formvalidate
- Answer: a) required

### 9. What is the correct HTML for adding a background color?
- a) <body bg="yellow">
- b) <background>yellow</background>
- c) <body style="background-color: yellow;">
- d) <bg color="yellow">
- Answer: c) <body style="background-color: yellow;">

### 10. Which HTML element is used to specify a footer for a document or section?
- a) <bottom>
- b) <footer>
- c) <section>
- d) <end>
- Answer: b) <footer>

### 11. Which of the following is the correct HTML5 declaration?
- a) <!DOCTYPE html>
- b) <!DOCTYPE HTML5>
- c) <DOCTYPE html>
- d) <!DOCTYPE HTML 5.0>
- Answer: a) <!DOCTYPE html>

### 12. Which tag is used to define an interactive field where users can enter data?
- a) <enter>
- b) <textarea>
- c) <form>
- d) <input>
- Answer: d) <input>

### 13. Which tag is used to display a picture in a webpage?
- a) <image>
- b) <img>
- c) <picture>
- d) <src>
- Answer: b) <img>

### 14. Which tag is used to create a dropdown list in a form?
- a) <list>
- b) <select>
- c) <input>
- d) <dropdown>
- Answer: b) <select>

### 15. Which HTML element is used to display preformatted text?
- a) <pre>
- b) <code>
- c) <format>
- d) <text>
- Answer: a) <pre>

### 16. **Which of these elements are all <table> elements?**
- a) <table> <tr> <tt>
- b) <thead> <body> <tr>
- c) <table> <tr> <td>
- d) <table> <tr> <footer>
Answer:r:** c) <table> <tr> <td>

### How can you open a link in a new tab/browser window?w?**
- a) <a href="url" new>
- b) <a href="url" target="_blank">
- c) <a href="url" target="new">
- d) <a href="url" new-tab>
Answer:r:** b) <a href="url" target="_blank">

### What is the correct HTML for creating a checkbox?x?**
- a) <check>
- b) <input type="checkbox">
- c) <checkbox>
- d) <input type="check">
Answer:r:** b) <input type="checkbox">

### Which HTML element is used to define important text?t?**
- a) <strong>
- b) <i>
- c) <important>
- d) <b>
Answer:r:** a) <strong>

### Which tag is used to create a list that displays items with bullets?s?**
- a) <ul>
- b) <ol>
- c) <li>
- d) <list>
Answer:r:** a) <ul>
6👍1
These questions cover a broad range of basic HTML concepts that are commonly tested in interviews.
👍1
👍2
👍2
👍3
3
👏4
🔥3
👍3
👍4