BSCS Quiz 1 SP25
Quiz: CSS Positioning, Floating, Flexbox, and Media Queries
Total Questions: 5 Marks: 10
Section A: Practical Questions
1. Positioning Challenge (2 Marks)
Write the CSS code to position a <div> element absolutely inside a parent <div> that has position: relative;. The child <div> should be placed 50px from the top and 100px from the left.
2. Floating Elements (2 Marks)
Create an HTML and CSS snippet where an image floats to the right of a paragraph of text. Ensure the text wraps around the image properly.
3. Flexbox Layout (2 Marks)
Using Flexbox, create a navigation bar that contains four menu items (Home, About, Services, Contact) and distributes them evenly across the full width of the page.
4. Media Query Task (2 Marks)
Write a CSS media query that changes the background color of a webpage to light gray when the screen width is smaller than 768px.