Search
 
SCRIPT & CODE EXAMPLE
 

CSS

div background image

#avatar {
    /* This image is 687 wide by 1024 tall, similar to your aspect ratio */
    background-image: url('http://i.stack.imgur.com/Dj7eP.jpg');
    
    /* make a square container */
    width: 150px;
    height: 150px;

    /* fill the container, preserving aspect ratio, and cropping to fit */
    background-size: cover;

    /* center the image vertically and horizontally */
    background-position: top center;

    /* round the edges to a circle with border radius 1/2 container size */
    border-radius: 50%;
}
Comment

div background image

div {
   /* Background pattern from Toptal Subtle Patterns */
   background-image: url("https://amymhaddad.s3.amazonaws.com/morocco-blue.png");
   height: 400px;
   width: 100%;
}
Comment

make image background of div

background-image: url("photographer.jpg");
Comment

PREVIOUS NEXT
Code Example
Css :: center a video horizontally 
Css :: text decoration none 
Css :: css reset style 
Css :: css last 3 childs 
Css :: css background half one color the other half another color 
Css :: how to make gradient backgroud cover whole page in html 
Css :: list-style-image size 
Css :: css img scale-down 
Css :: Bootstap 5.2.0 cdn 
Css :: css change text 
Css :: cursor: not-allowed is not working with pointe events none in css 
Css :: css circle border 
Css :: tailwind absolute center 
Css :: css important 
Css :: How to check tailwindcss version 
Css :: css grid center 
Css :: position absolute center 
Css :: add background image and color css 
Css :: ratio bootstrap 
Css :: how to link fonts css 
Css :: css smooooooth scroll 
Css :: css not last of type 
Css :: css background image svg not showing 
Css :: make blur with css 
Css :: faire un fond fade to transparent css 
Css :: How to remove specific td border in css 
Css :: css change image saturation 
Css :: putting label on top of input css 
Css :: how to make the list in css with square 
Css :: css system default font 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =