Page 91 - Plus_V2.2_C7_Flipbook
P. 91
Using inline style sheet
Inline style is feasible for small pages or quick styling adjustments, but it becomes less maintainable
for larger projects due to the repetition of styles for similar elements.
BASIC CSS PROPERTIES
Let us learn about some basic css properties.
Background Properties
The background properties are used to make changes in the background of a web page. The various
background properties and their values are given in the table.
Property Value
background-color name of the colour
background-image URL of image
background-position top, bottom, left, right, center
repeat, repeat-x, repeat-y, (whereas, x-horizontal & y-vertical),
background-repeat
no-repeat
background-attachment scroll, fixed
background-color
It specifies the background color of an element.
Example: background-color: Blue;
background-image
It specifies one or more background images for an element.
Example: background-image: url('background.jpg');
background-position
It sets the initial position of the background image.
Example using keywords: background-image: url('background.jpg');
background-position: top;
Example using length values: background-image: url('background.jpg');
background-position: 10px;
Example using percentages: background-image: url('background.jpg');
background-position: 50%;
Using CSS in HTML5 89

