CSS (Cascading Style Sheets) allows adding layout and design to websites in a new way and is essential for web design. CSS can be applied to HTML elements inline using the style attribute, or internally using the <style> tag placed in the <head> section. For example, to make the page background red with CSS, the code "body {background-color: #FF0000;}" can be placed within <style> tags or applied directly to the <body> element's style attribute.
1 of 4
Download to read offline
More Related Content
Babitha3.css
1. Introduction About CCS Cascading Style Sheets (CSS) is a fantastic tool to add layout to your websites. It can save you a lot of time and it enables you to design websites in a completely new way. CSS is a must for anyone working with web design. Using CSS requires basic experience with HTML.
2. The basic CSS syntax L et's say we want a nice red color as the background of a webpage: Using HTML we could have done it like this: <body bgcolor="#FF0000"> With CSS the same result can be achieved like this: body {background-color: #FF0000;}
3. Method 1: In-line (the attribute style) One way to apply CSS to HTML is by using the HTML attribute style. Building on the above example with the red background color, it can be applied like this: <html> <head> <title>Example</title> </head> <body style="background-color: #FF0000;"> <p>This is a red page</p> </body> </html>
4. Method 2: Internal (the tag style) Another way is to include the CSS codes using the HTML tag <style>. For example like this: <html> <head> <title>Example</title> <style type="text/css"> body {background-color: #FF0000;} </style> </head> <body> <p>This is a red page</p> </body> </html>