CodingQuesions (AssignmentQuestions) 1
CodingQuesions (AssignmentQuestions) 1
• A header section with a main heading (<h1>) and a brief welcome message.
• A middle section with a subheading (<h2>) and a short paragraph about yourself.
• A footer section with contact information styled using Internal CSS.
2. Write an HTML file styled with External CSS that includes:
• A <div> with a light blue background, 20px padding, and a black border.
• Inside the <div>, add a heading (<h2>) and two paragraphs describing the
importance of using <div> tags.
3. Design a webpage that demonstrates the difference between Class and ID Selectors in
CSS:
• Create a <div> with a class of box and style it with a green background and 10px
padding.
• Create another <div> with an ID of highlight and style it with a yellow
background and bold text.
4. Build a webpage that uses the <img> tag to display an image:
• Use Inline CSS to style the buttons with different colors and font sizes.
• Add a JavaScript onclick event to the "Click Me" button that displays an alert.
7. Write a webpage to demonstrate the CSS Box Model:
• Include a <div> with content styled with padding, margin, and a border.
• Use Internal CSS to apply different colors for each area (padding, border, margin).
8. Create a webpage that uses the <img> tag with inline styles:
• Display an image with a red border, 10px margin, and centered alignment.
• Add a paragraph below the image describing its content.
9. Build a webpage that combines Group Selectors and Class Selectors:
• Group <h1>, <h2>, and <p> elements using a group selector to apply common
styles like text color and alignment.
• Use a class to apply additional unique styles to specific paragraphs.
10.Write an HTML file to demonstrate CSS specificity rules:
• Create a <p> element styled with:
• Element selector for text color (black).
• Class selector for text color (blue).
• ID selector for text color (green).
• Inline styles for text color (red).
• Observe and explain which style takes precedence and why.