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 :: css nth child 
Css :: how to create a shape in css 
Css :: how to use image zoom effect in css 
Css :: last child after css 
Css :: force css style in angular 
Css :: css text align center 
Css :: css combinators 
Css :: Correct border property to add ROUNDED borders to the elements 
Css :: gray scale css 
Css :: css button pressed effect 
Css :: SassError: Top-level selectors may not contain the parent selector "&" 
Css :: jquery replace css class 
Css :: link active css 
Css :: glass css 
Css :: how to make div scrollable horizontal 
Css :: media query for max width and height 
Css :: mysql_config not found 
Css :: overflow property 
Css :: cool gradient 
Css :: how to make fixed position responsive 
Css :: css background property 
Css :: letter spacing in css 
Css :: simple css reset 
Css :: refresh css on page 
Css :: postcss plugin 
Css :: loading bar css 
Css :: css clip 
Css :: margin bottom not working 
Css :: text align left css 
Css :: blur background image css 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =