I have the following HTML/CSS page that successfully centers an image file in the exact middle of a Bootstrap 3 page:
<head>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="splash.css" media="screen" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
</head>
<html>
<style>
html, body{
height: 100%;
margin: 0;
padding: 0 0;
background-color: #D1E5EE;
}
.container-fluid{
height:100%;
display:table;
width:100%;
padding-right:0;
padding-left: 0
}
.row-fluid{
height:100%;
display:table-cell;
vertical-align: middle;
text-align: center;
width:100%
}
</style>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div>
<img src="images/splash.svg">
</div>
</div>
</div>
</body>
</html>
What I'd like to be able to do is, using CSS, to also have the image in question scale as the browser resizes.
I tried adding something like
.splash-image{
height: 80%;
width: 80%;
}
and then adding a splash-image
class to the <img>
tag, but it pushes the image to the right for some reason, and then kind of scales in a hurky-jerky kind of way.
Is there a way to set up the code above so that the image will rescale as the browsre window resizes?