Unit 3
Unit 3
HTML CODE:
<body link="blue" alink="red" vlink="purple"> <a
href="https://www.example.com">Visit Example</a> </body>
Setting a Background Image
Background Image with <body>:
Code:
<body background="background.jpg">
<h1>Welcome to My Page</h1>
</body>
Solid Background Color
Solid Color Background:
Code:
<body bgcolor="lightgreen">
<h1>Welcome to My Page</h1>
</body>
Using CSS for Backgrounds
CSS Background Image and Colors:
Code:
<body style="background-color: lightgray;">
<h1>Welcome to My Page</h1>
</body>
CSS for Background Image
Code
<body style="background-image: url('background.jpg'); background-repeat: no-repeat;
background-size: cover;"> <h1>Welcome to My Page</h1> </body>
Summary
Images:
Use appropriate formats (JPG, PNG, GIF).
Optimize images for performance.
Align and size images correctly for layout.
Colors and Backgrounds:
Use CSS for better control over text and background styling.
Choose colors that ensure readability and good contrast.
THANK YOU