I encountered an issue while trying to convert an image grid from using external CSS to inline style. When I moved all the attributes inline, the h3 element disappeared. Can anyone assist with this problem?
Here is the original external CSS:
<script>
.image-zoom-container {
list-style: none;
font-size: 0px;
}
.zoom-container {
position: relative;
overflow: hidden;
display: inline-block;
width: 33.33%;
font-size: 16px;
font-size: 1rem;
border: 1px solid #fff;
vertical-align: top;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.zoom-container img {
display: block;
width: 100%;
height: auto;
}
.zoom-container .zoom-caption {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
}
.zoom-container .zoom-caption h3 {
display: block;
text-align: center;
font-family: 'Source Sans Pro', sans-serif;
font-size: 1.5em;
font-weight: 900;
letter-spacing: -1px;
text-transform: uppercase;
color: #fff;
margin: 23% 0 0;
padding: 10px 0;
}
</script>
The HTML using external CSS:
<html>
<head>
<link rel="stylesheet" href="main.css">
</head>
<div class="image-zoom-container">
<div class="zoom-container">
<span style="zoom-caption">
<h3>Text</h3>
</span>
<img src="test.png" />
</div>
</div>
However, when converted to inline style it doesn't work properly:
<html>
<head>
</head>
<body>
<div style="list-style: none; font-size: 0px;">
<div style="position: relative; overflow: hidden; display: inline-block; width: 33.33%; border: 1px solid #fff; vertical-align: top; box-sizing: border-box; -moz-box-sizing: border-box;">
<a href="#">
<span style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;">
<h3 style="display: block; text-align: center; font-size: 1.5em;">Costa Rica</h3>
</span>
<img style="display: block; width: 100%; height: auto;" src="Selection_009.png" />
</a>
</div>
</div>
</body>
</html>