0

I am new to HTML and CSS. I am trying to center an image at the top center of the container and then add text below it. I am not sure where i am going wrong here

body {
    margin: 0;
}

h1, h2 {
    font-family: 'Amatica SC', cursive;
    font-weight: 700;
    text-align: center;
}

p {
    font-family: 'Open Sans Condensed', sans-serif;
}

.header {
    background-color: skyblue;
    height: 100px;
    text-align: center;
    color: #4f889f;
    padding: 1px;
}

.container div {
    padding: 1%;
    box-sizing: border-box;
    min-height: 500px;
}

#container .left-col img {
    min-width: 70px;
    min-height: 70px;
    max-width: 250%;
    max-height: 250%;
    top: -50%;
    left: -50%;
    bottom: -50%;
    right: -50%;
    position: absolute;
}

.left-col, .right-col {
    background-color: #f4f4f4;
    width: 25%;
    float: left;
}
<body>
<div class="header">
    <h1>The 3 Column Layout</h1>
</div>
<div class="container">
    <div class="left-col">
        <img src="Cyber.jpg" width="200" height=150"/>
    </div>
</div>
</body>

I am trying to center this image in the middle How can I do that?

Krzysztof Janiszewski
  • 3,542
  • 3
  • 15
  • 33
Jake
  • 33
  • 4

0 Answers0