Background Image Size

0 Jeff Gong · September 1, 2015
what if the image you want for your background is to big? is there a way (without using photoshop) to resize my image? Does the img src height thing work in the style tags?

Post a Reply

Replies

Oldest  Newest  Rating
0 Casper Hollemans · October 1, 2015
@uma singh
Always do it in the body tag of css for a proper structure.
it's also the best to define the background image in css
0 uma singh · October 1, 2015
#image {
   width: 400px;
   height: 200px;
}
then
<img id="image" src="image.jpg"/>

second option is

div {
    background: url(img_flwr.gif);
    background-size: 80px 60px;
    background-repeat: no-repeat;
}
+1 Casper Hollemans · September 16, 2015
I always use these css codes for a general background what should cover evrything :)
background-repeat: no-repeat;
background-attachment:fixed;
background-image: url('background.jpg');
background-size: cover;
0 Brotsky Tv · September 15, 2015
Check out this link, might that explanation help you out !

1) https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Background_and_Borders/Scaling_background_images
2) http://www.w3schools.com/cssref/css3_pr_background-size.asp



Click here to know more for HTML tutorials: https://www.brotsky.tv/category/html/
0 Jeff Gong · September 2, 2015
thanks guys 
it really helped
0 kudakwashe masangomai · September 1, 2015
background-size: 1400px;

max-width:100%;

max width is for a responsive page;;
  • 1

HTML / CSS / Web Design

107,052 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators