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

Mod 6 pdf

Uploaded by

remon.youssef317
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Mod 6 pdf

Uploaded by

remon.youssef317
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Flashcards
Q: What are the three parts of CSS syntax?
A: Selector, property, and value.
Q: What does the position: fixed; property do?
A: It keeps elements in place in the viewport, regardless of page scrolling.
Q: What is the default position value for all HTML elements?
A: static.
Q: How do you add comments in CSS?
A: Use /* comment */.

2. Explain Concepts in Simple Terms


Concept: CSS Selectors
Explanation: Selectors decide which HTML elements you want to style. It's like
pointing at parts of your web page and saying, "Style this part!" For example,
#header targets an element with the ID "header", and .button targets all elements
with the class "button".
Concept: CSS Positioning
Explanation: Positioning in CSS lets you decide where elements appear on a page.
For example:
 static (default): No special positioning.
 relative: Adjusts position relative to where it would naturally be.
 absolute: Positions relative to the nearest positioned parent.
 fixed: Stays in the same place even when scrolling.
 sticky: Switches between relative and fixed based on scroll.

3. Most Important Points to Remember


 CSS Syntax: Always use a selector, a property, and a value (e.g., h1 {color:
red;}).
 Positioning: Use static for default flow, relative to shift slightly, absolute for
precise placement, and fixed for sticky elements.
 Comments: Always comment your code for clarity (/* comment */).
 Box Model: Understand padding, border, margin, and content.

4. Key Terms and Definitions


 Selector: Targets elements for styling. Example: p targets all <p> tags.
 Property: Describes what aspect to style. Example: color.
 Value: Specifies the style. Example: red for color.
 Position: Controls element placement. Example: position: absolute;.

5. Quiz Questions
Multiple Choice:
1. What is the default position of HTML elements?
a) relative
b) fixed
c) static
d) absolute
Answer: c) static
2. What does the # symbol in CSS represent?
a) Class selector
b) ID selector
c) Tag selector
d) Attribute selector
Answer: b) ID selector
3. Which property is used to move an element out of its normal flow?
a) float
b) margin
c) padding
d) color
Answer: a) float

You might also like