Home » » css background image

css background image

css background image

The background-image property specifies an image to use as the background of an element. By default, the image is repeated so it covers the entire element.

css background image Code

p { background-image: url(shahidminar.jpg); }

Example:
<HTML>
    <HEAD>
        <STYLE>
            BODY{BACKGROUND-IMAGE: URL(SHAHIDMINAR.JPG);}
        </STYLE>
        <TITLE>
            CSS EXAMPLE-IMAGE BACKGROUND
        </TITLE>
    </HEAD>
    <BODY>
        WELCOME TO MY FIRST WEB PAGE
    </BODY>
</HTML>



CSS Background Image Positioning

If you would like to define where exactly an image appears within an HTML element, you may use CSS's background-position. Please take note that there are three different ways of defining position: length, percentages, and keywords.

CSS Code

p {
    background-image: url(shahidminar.jpg);
    background-position: 20px 10px;
}

h4{
    background-image: url(shahidminar.jpg);
    background-position: 30% 30%;
}

ol{
    background-image: url(shahidminar.jpg);
    background-position: top center;
}

0 মন্তব্য(গুলি):

একটি মন্তব্য পোস্ট করুন

Comment below if you have any questions

Contact form

নাম

ইমেল *

বার্তা *