Telegram Group & Telegram Channel
To put an image as a background in CSS seems a little overwhelming since the images position won't be as perfect as we want it. Whether to put an image on a specific part of the screen or to cover the whole screen as a background, following a little rule would make it a lot easier.

For a full background we would put the property on the body tag, so it can can be applied through the whole page, but that is not a good idea to do that if we are building a website that we actually scroll. In order for that to happen we need to wrap the whole thing in a div or a section tag. And give that a class or an id and give the property using css. The property on the css on an element that has a class of showcase would look like..

.showcase{
background: url('./showcase.jpg'); //the image must be on the same directory...if it was on another folder we would have to change the url. If that is hard, contact me through @jamesScript i would personally guide you through that.

.showcase{
Background: url('showcase.jpg');
background-size: cover; //makes the image not be cropped
Background-repeat: no-repeat; //this would make the image not get repeated and look horrendous.
Background-position: center; //this will position it at the center
height: 100vh; //this would give it the height of the whole screens, if you consider the screen as a 100 slices saying 100vh means saying 100 slices, saying 50vh means half the screens half slice..
These properties would position the image as the screen background..



tg-me.com/DiaryOfaProgrammer/83
Create:
Last Update:

To put an image as a background in CSS seems a little overwhelming since the images position won't be as perfect as we want it. Whether to put an image on a specific part of the screen or to cover the whole screen as a background, following a little rule would make it a lot easier.

For a full background we would put the property on the body tag, so it can can be applied through the whole page, but that is not a good idea to do that if we are building a website that we actually scroll. In order for that to happen we need to wrap the whole thing in a div or a section tag. And give that a class or an id and give the property using css. The property on the css on an element that has a class of showcase would look like..

.showcase{
background: url('./showcase.jpg'); //the image must be on the same directory...if it was on another folder we would have to change the url. If that is hard, contact me through @jamesScript i would personally guide you through that.

.showcase{
Background: url('showcase.jpg');
background-size: cover; //makes the image not be cropped
Background-repeat: no-repeat; //this would make the image not get repeated and look horrendous.
Background-position: center; //this will position it at the center
height: 100vh; //this would give it the height of the whole screens, if you consider the screen as a 100 slices saying 100vh means saying 100 slices, saying 50vh means half the screens half slice..
These properties would position the image as the screen background..

BY Programming Diaries


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/DiaryOfaProgrammer/83

View MORE
Open in Telegram


Programming Diaries Telegram | DID YOU KNOW?

Date: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

Programming Diaries from us


Telegram Programming Diaries
FROM USA