Difference between revisions of "CSS Background Image"

From Level Access Web Labs
Jump to navigation Jump to search
Line 25: Line 25:
 
       height:153px;
 
       height:153px;
 
   }
 
   }
 +
 +
  .image {
 +
  background-image:url('https://labs.levelaccess.com/images/f/ff/Small_star.jpg');
 +
      background-size: 156px 153px;
 +
      background-repeat:no-repeat;
 +
      border:solid thin;
 +
      padding:0;
 +
      width:155px;
 +
      height:153px;
 +
  }
 +
 +
 
   </style></head>
 
   </style></head>
 
   <body>
 
   <body>
Line 31: Line 43:
 
     <p>background image without transparent color</p>
 
     <p>background image without transparent color</p>
 
     <div id="d2">&nbsp;</div>
 
     <div id="d2">&nbsp;</div>
 +
    <h2><span class="image"></span>Test</h4>
 
   </body>
 
   </body>
 
</html>
 
</html>
 
[[Category:Techniques]]
 
[[Category:Techniques]]
 
[[Category:CSS]]
 
[[Category:CSS]]

Revision as of 16:04, 6 October 2020

Example of the CSS Background Image property background-image.

background image with transparent color

This is some text.

background image without transparent color

 

Test