CSS is used to control the style of a web document in a simple and easy way. CSS stands for Cascading Style Sheets.SS is a language that describes the style of an HTML document. CSS describes how HTML elements should be displayed. CSS can be added to HTML elements in 3 ways:
INLINE CSS
INLINE By using the style attribute in HTML elements.
<p style=”color:blue”>Paragraph is blue color</p>
INTERNAL CSS
INTERNAL CSS By using the <style> element in <head> section
Example:
<head>
<style type="text/css">
body{
background-color:blue;
}
</style>
</head>
EXTERNAL CSS
EXTERNAL CSS By using external CSS Files.Create an external stylesheet named mystyle.css
It uses the <link> tag on every pages and the <link> tag should be put inside the head section.
Example:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
CSS BACKGROUND
It define the background effects for elements.
Css background properties are as follows :
Background color : This property specifies the background color of an element.
Example:
body { background-color:red; }
Background Image : This property specify an image to use as the background of an element. By default, the image is repeated so it covers the entire element.
Example:
body { background-image : url("/myimage.jpg"); }
Background repeat : By default the background image property repeats the image both horizontally and vertically.
Example:
body { background-image:url("/sun.jpg"); background-repeat: repeat:x;
/* background-repeat: repeat:y; vertical*/
}
Background-attachment : This property is used to fix the background ground image.The image will not scroll with the page.
Example:
body { background-attachment: fixed; }
Background-position : This property is used to set the image to a particular position.
Example:
body { background-repeat:no repeat; background-position:right top; }
You have successfully subscribed to the newsletter
There was an error while trying to send your request. Please try again.