Jump to content
Sign in to follow this  
ScriptShow

Simple CSS Center Image Responsive Compatible

Recommended Posts

Simple CSS Center Image Responsive Compatible.

 

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width">
<style type="text/css">
.img {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<img class="img" src="image.jpg">
</body>
</html>

Un saludo.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×