Skip to main content

CSS Backgrounds (Images and Colours)

Body
Introduction: This is the third part in my CSS Styling tutorials, in which I will be covering backgrounds. Different Types of Backgrounds: In CSS, you can choose to set the background equal to an image, this can either be a url or a local file directory path, or a colour. Image Settings: Here is an example of setting the background of a class named 'myDiv' to background.jpg...
  1. 
  2. .myDiv {
  3. background: url('background.jpg');
  4. background-image: url('background.jpg');
  5. }
In the above example, the background.jpg file is located in the same directory folder as the page itself (the

Add new comment

Screenshot