Web Page Designing (312004) Practical No.22: Create CSS by applying style sheets
Web Page Designing (312004) Practical No.22: Create CSS by applying style sheets |
Cascading Style Sheet (CSS) is a simple mechanism for describing how documents are shown on screens. Cascading Style Sheets (CSS) provide straightforward and practical alternatives to specify different attributes for the HTML tags. This Web Page Designing (312004) practical No.22 shows the usage of CSS and improves content accessibility.
Exercise
1) Create a web page for a demonstration of CSS by applying an internal style, external, and inline style
Answer:
<!DOCTYPE html><html lang=”en”><head><meta charset=”UTF-8″><meta name=”viewport” content=”width=device-width, initial-scale=1.0″><title>CSS Demonstration</title><!– External Style –><link rel=”stylesheet” href=”styles.css”><!– Internal Style –><style>/* Internal Style */.internal-style {color: blue;font-size: 20px;font-weight: bold;}</style></head><body><!– Inline Style –><h1 style=”color: red;”>This is a heading with inline style</h1><p class=”internal-style”>This paragraph has internal style applied.</p><div class=”external-style”>This div has external style applied.</div><p>This paragraph does not have any specific style applied.</p></body></html>
Output:
Explain the font property with syntax
Answer:
Syntax:
font: [font-style] [font-variant] [font-weight] [font-size]/[line-height] [font-family];
- normal (default) – Upright font
- italic – Slanted font
- oblique – Similar to italic, but the angle of the slant can vary depending on the font
Conclusion
We successfully learn how to Create CSS by applying style sheets in HTML.