HTML/CSS Study

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

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.

35 Terms

1
New cards

Basic HTML skeleton for every webpage

"<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Page</title>
</head>
<body>
Hello world!
</body>
</html>"

2
New cards

Add a page title that appears in the browser tab

"<title>My First Page</title>"

3
New cards

Create headings of different importance

"<h1>Main Title</h1>
<h2>Subtitle</h2>
<h3>Section heading</h3>"

4
New cards

Write a paragraph of text

"<p>This is a paragraph of text.</p>"

5
New cards

Insert an image with alternate text

"<img src="cat.jpg" alt="A cute cat" width="300">"

6
New cards

Add a clickable link that opens in a new tab

"<a href="https://www.ibm.com" target="_blank">Visit IBM</a>"

7
New cards

Make an unordered and ordered list

"<ul>
<li>HTML</li>
<li>CSS</li>
</ul>

<ol>
<li>First</li>
<li>Second</li>
</ol>"

8
New cards

Use semantic structure tags for layout

"<header>Header area</header>
<nav>Navigation menu</nav>
<main>Main content</main>
<footer>Footer info</footer>"

9
New cards

Group content with a div, class, and id

"<div class="container" id="main-section">
<p>Content inside a div.</p>
</div>"

10
New cards

Target elements with CSS selectors

"p { color: blue; }
.container { background: lightgray; }

main-section { padding: 10px; }"

11
New cards

Link an external CSS file

"<link rel="stylesheet" href="styles.css">"

12
New cards

Add inline CSS for a quick style

"<p style="color: red;">Inline styled paragraph</p>"

13
New cards

Change the page background color

"body { background-color: #f4f4f4; }"

14
New cards

Change text color of a heading

"h1 { color: darkblue; }"

15
New cards

Adjust font size of text

"p { font-size: 18px; }"

16
New cards

Set the font family for the page

"body { font-family: Arial, sans-serif; }"

17
New cards

Center a block-level div horizontally

".box {
width: 300px;
margin: 0 auto;
background: lightblue;
}"

18
New cards

Center text inside an element

"h1 { text-align: center; }"

19
New cards

Add padding and margin around an element

".box {
padding: 20px;
margin: 20px;
}"

20
New cards

Set a fixed width and height for an element

"div {
width: 200px;
height: 100px;
background: coral;
}"

21
New cards

Specify display types for elements

"span { display: inline; }
div { display: block; }
button { display: inline-block; }"

22
New cards

Align items with flexbox

".flex {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}"

23
New cards

Create a 3-column grid layout

".grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}"

24
New cards

Position an element inside a relative parent

".parent { position: relative; }
.child {
position: absolute;
top: 10px;
left: 20px;
}"

25
New cards

Apply CSS only when the screen width is small

"@media (max-width: 600px) {
body { background-color: lightpink; }
}"

26
New cards

Change button style when hovered

"button:hover {
background-color: darkblue;
color: white;
}"

27
New cards

Add a smooth color transition on hover

"button {
background: blue;
transition: background 0.3s ease;
}
button:hover { background: navy; }"

28
New cards

Make a simple form with label, input, and button

"<form>
<label for="email">Email:</label>
<input type="email" id="email">
<button>Submit</button>
</form>"

29
New cards

Style form input and button elements

"input {
padding: 8px;
border: 1px solid #ccc;
}
button {
background: blue;
color: white;
border: none;
padding: 10px;
}"

30
New cards

Load and use an external Google Font

"<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">

body { font-family: 'Poppins', sans-serif; }"

31
New cards

Ensure box model consistency with box-sizing

"* {
box-sizing: border-box;
}"

32
New cards

Add alt text for accessibility on images

"<img src="dog.jpg" alt="Brown Labrador dog">"

33
New cards

Write valid nested HTML markup

"<!-- ✅ valid -->
<p><strong>Hello</strong></p>
<!-- ❌ invalid -->
<p><strong>Hello</p></strong>"

34
New cards

Add an image with a caption underneath

"<figure>
<img src="chart.png" alt="Sales chart">
<figcaption>Q1 Sales Growth</figcaption>
</figure>"

35
New cards

Use clear BEM-style class names

"<div class="card card--highlight">
<h2 class="card__title">Profile</h2>
</div>"