# Correct the HTML fully following the right approach to stretch the tiles and eliminate the white space
truly_fixed_html_content = f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Reliable Policy Ad</title>
<meta name="ad.size" content="width=300,height=250">
<style>
html, body {{
margin: 0; padding: 0; width: 300px; height: 250px; overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, Arial, Helvetica, sans-serif;
background: #FFFFFF;
}}
#container {{
width: 100%; height: 100%; box-sizing: border-box;
padding: 6px 8px 4px;
display: flex; flex-direction: column;
}}
#headline {{
font-size: 16px; font-weight: 700; color: #002F6C; text-align: left; line-height: 1.3;
margin: 2px 0 6px 0;
}}
#subhead {{
font-size: 14px; font-weight: 700; color: #0070C9; text-align: center;
margin: 0 0 8px 0; text-transform: uppercase;
}}
.age-grid {{
flex-grow: 1;
display: grid; grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 1fr; /* Make the rows stretch equally */
gap: 4px;
margin-bottom: 0;
}}
.tapme {{
background: #0070C9; color: #FFFFFF; font-size: 16px; font-weight: 700;
text-align: center; border-radius: 6px;
display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
cursor: pointer; transition: background 0.2s, box-shadow 0.2s;
}}
.tapme:hover {{
background: #002F6C;
box-shadow: 0 3px 6px rgba(0, 47, 108, 0.25);
}}
#footer {{
display: flex; justify-content: space-between; align-items: center; font-size: 13px;
margin-top: 4px; flex-shrink: 0;
}}
.footer-msg {{
font-style: italic; color: #FF6600;
}}
.logo {{
width: 110px;
height: auto;
}}
</style>
</head>
<body>
<div id="clickArea">
<div id="container">
<div id="headline">Texas Homeowners Insurance:</div>
<div id="subhead">Tap Your Age:</div>
<div class="age-grid">
<div class="tapme">25 - 34</div>
<div class="tapme">35 - 44</div>
<div class="tapme">45 - 54</div>
<div class="tapme">55 - 64</div>
<div class="tapme">65 - 74</div>
<div class="tapme">75 +</div>
</div>
<div id="footer">
<div class="footer-msg">$97/month Home Insurance</div>
<img class="logo" src="{logo_base64_src}" alt="Reliable Policy" />
</div>
</div>
</div>
<script>
var clickTag = "https://home.reliablepolicy.com/";
document.getElementById("clickArea").onclick = function() {{
window.open(clickTag, "_blank");
}};
</script>
</body>
</html>"""
# Save the fully corrected file
truly_fixed_file_path = '/mnt/data/reliable-policy-ad-truly-fixed.html'
with open(truly_fixed_file_path, 'w') as f:
f.write(truly_fixed_html_content)
truly_fixed_file_path
2
1
3KB
3KB
126.0ms
396.0ms
180.0ms