Site icon T4Tutorials.com

CSS Backgrounds

Background-Image in HTML and CSS

body {
    background-image: url("logo.jpg");
}

Try it

Background – Shorthand property in HTML and CSS

body {
    background: url("logo.jpg") no-repeat right ;
    text-align: left;
}

Try it

Background Image – Set position and no-repeat in HTML and CSS

body {
    background-image: url("logo.jpg");
    background-repeat: no-repeat;
    background-position: center;
    text-align: center;
}

Try it

Different Background Colors in HTML and CSS

h1 {
    border-style: solid;
    border-width: 10px;
    text-align: center;
    background-color: lightgray;
    color: gray;
    margin: 50px;
}

.aa {
    background-color: lightpink;
    border-style: solid;
    color: red;
    font-size: 30px;
}

p {
    text-align: left;
    background-color: black;
    color: white;
}

Try it

Video Lecture

Exit mobile version