Hey everyone! I'm a newcomer to this community and a newbie when it comes to HTML. :D
I encountered a problem recently and discovered that Stackoverflow is full of amazing developers. That's why I've decided to share my problem here and am eagerly awaiting your assistance!
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cafe</title>
<style>
#container {
width:550px;
height:733px;
position:relative;
}
img#containerImage {
position:absolute;
left: 0;
top: 0;
}
h1#header {
z-index: 100;
position: absolute;
color: white;
font-size:24px;
font-weight:bold;
border:1px solid red;
margin: 0px;
vertical-align: middle;
text-align: center;
}
</style>
</head>
<body>
<div id="container">
<img id="containerImage" src="olgagonggam.jpg"/>
<h1 id="header">Cafe</h1>
</div>
</body>
</html>
This is the code I've written. I'm puzzled as to why the text isn't centered/middle aligned, and how can I rectify this issue? Currently, the text is displayed on the top left corner of the page, but my intention is for it to be centered on the image. Can someone lend me a hand, please? :D