web programing

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

Match the CSS property with its correct function:

  1. color

  2. font-size

  3. border

  4. margin

  5. padding

A. Controls the space around an element (outside the border).
B. Controls the text color.
C. Controls the space inside an element (between content and border).
D. Defines the size of the text.
E. Defines the edges of an element.

B, D, E, A, C

2
New cards

Which of the following is a valid way to apply CSS to an HTML document?
a) Inline styles
b) Embedded styles
c) External styles
d) All of the above

d) All of the above

3
New cards

What does the # symbol represent in CSS?
a) Class selector
b) ID selector
c) Universal selector
d) Element selector

b) ID selector

4
New cards

Which CSS property is used to control the spacing between lines of text?
a) letter-spacing
b) line-height
c) word-spacing
d) text-align

b) line-height

5
New cards

What is the default positioning of an HTML element?
a) Absolute
b) Fixed
c) Static
d) Relative

c) Static

6
New cards

Which CSS unit is relative to the font size of the root element?
a) px
b) em
c) %
d) rem

d) rem

7
New cards

1. Write a CSS rule that applies a blue background color to all <p> elements.

p {

background-color: blue;

}

8
New cards

Write a CSS rule to create a red border (2px solid) around a div with the ID "container".

#container {

border: 2px solid red;

}

9
New cards

Write a CSS rule that makes all links (<a> elements) turn green when hovered over.

a:hover {

color: green;

}

10
New cards

Write a CSS rule that applies a font size of 18px and text color of gray to all elements with the class "text-style".

.text-style {

font-size: 18px; color: gray;

}

11
New cards

Match the HTML tag with its correct function:

HTML Tag

Function

1. <p>

A. Creates a hyperlink.

2. <h1>

B. Embeds an image.

3. <a>

C. Defines a paragraph.

4. <img>

D. Creates an unordered list.

5. <ul>

E. Defines the largest heading.

  1. - C. Defines a paragraph.

  2. - E. Defines the largest heading.

  3. - A. Creates a hyperlink.

  4. - B. Embeds an image.

  5. - D. Creates an unordered list.

12
New cards

What is the correct DOCTYPE declaration for HTML5?
a) <!DOCTYPE html5>
b) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
c) <!DOCTYPE html>
d) <html lang="en">

c) <!DOCTYPE html>

13
New cards

Which HTML tag is used to define an unordered list?
a) <ol>
b) <ul>
c) <list>
d) <li>

b) <ul>

14
New cards

Which of the following is a self-closing tag in HTML?
a) <div>
b) <p>
c) <img>
d) <h1>

c) <img>

15
New cards

Which attribute is used to specify an alternative text for an image?
a) title
b) alt
c) src
d) href

b) alt

16
New cards

Which of the following elements is used for navigation in HTML5?
a) <header>
b) <nav>
c) <footer>
d) <aside>

b) <nav>

17
New cards

Write a basic HTML5 document structure.

<!DOCTYPE html>

<html lang="en">

<head>

<title>My First Page</title>

</head>

<body>

<h1>Welcome to My Website</h1>

<p>This is a sample webpage.</p>

</body>

</html>

18
New cards

Write an HTML code snippet to create a hyperlink to "https://example.com".

<a href="https://example.com">Visit Example</a>

19
New cards

Which CSS property is used to change the background color?
a) color
b) background-color
c) text-color
d) bgcolor

b) background-color

20
New cards

Match the HTML form element with its purpose:

HTML Tag

Purpose

1. <input type="text">

A. Allows multi-line text input.

2. <input type="radio">

B. Creates a dropdown list.

3. <select>

C. Accepts text input.

4. <textarea>

D. Creates a clickable button.

5. <button>

E.Allows one option selection.

  1. C. Accepts text input.

  2. E. Allows one option selection.

  3. B. Creates a dropdown list.

  4. A. Allows multi-line text input.

  5. D. Creates a clickable button.

21
New cards

Which form method should be used to securely send sensitive data?
a) GET
b) POST
c) SEND
d) DATA

b) POST

22
New cards

Which table element defines a table row?
a) <tr>
b) <td>
c) <th>
d) <table>

a) <tr>

23
New cards

Which attribute is used to group multiple checkboxes under the same name?
a) group
b) value
c) name
d) id

c) name

24
New cards

rite an HTML form with a text input, a password field, and a submit button.


<form action="submit.php" method="post"> 
    <label for="username">Username:</label>       	         
    <input type="text" id="username" name="username"> 
         <label for="password">Password:</label>
         <input type="password" id="password" name="password">
          <input type="submit" value="Login"> </form> 

25
New cards

Write an HTML table with 3 rows and 2 columns.

html
<table border="1">
     <tr>
         <th>Header 1</th>
         <th>Header 2</th>
     </tr>
     <tr>
         <td>Row 1, Col 1</td>
         <td>Row 1, Col 2</td>
     </tr>
     <tr>
         <td>Row 2, Col 1</td>
         <td>Row 2, Col 2</td>
     </tr>
 </table>

26
New cards

Matching Questions (Tables)

HTML Table Element

Function

1. <tbody>

H. Groups the table footer rows.

2. <td>

B. Defines a table row.

3. <tfoot>

G. Groups the table body rows.

4. rowspan

I. Merges multiple columns into one cell.

5. <tr>

C. Defines a standard data cell.

6. <caption>

F. Groups the table header rows.

7. <table>

E. Provides a title for the table.

8. <th>

A. Defines a table.

9. <thead>

J. Merges multiple rows into one cell.

10. colspan

D. Defines a table header cell.

Matching Questions (Tables)

  1. - G. Groups the table body rows.

  2. - C. Defines a standard data cell.

  3. - H. Groups the table footer rows.

  4. rowspan - J. Merges multiple rows into one cell.

  5. - B. Defines a table row.

  6. - E. Provides a title for the table.

  7. - A. Defines a table.

  8. - F. Groups the table header rows.colspan

  9. - I. Merges multiple columns into one cell.

  10. - D. Defines a table header cell.

27
New cards

Which HTML tag is used to create a table?
a) <tbl>
b) <table>
c) <tab>
d) <t>

b) <table>

28
New cards

What does the colspan attribute do in an HTML table?
a) Merges multiple rows into one cell
b) Merges multiple columns into one cell
c) Deletes a column
d) Changes the column width

b) Merges multiple columns into one cell

29
New cards

What is the correct HTML code to add a table header?
a) <td>
b) <tr>
c) <th>
d) <thead>

c) <th>

30
New cards

Which tag groups the body section of a table?
a) <thead>
b) <tfoot>
c) <tbody>
d) <table>

c) <tbody>

31
New cards

What is the default alignment of table text?
a) Left
b) Center
c) Right
d) Justified

a) Left

32
New cards

Which CSS property removes space between table cells?
a) border-spacing: 0;
b) border-collapse: collapse;
c) table-collapse: merge;
d) spacing: 0;

b) border-collapse: collapse;.