Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm struggling to have my "OpenSource Inc" text and "Live to Code" text appear centrally within my image.

Think its just an issue with sorting out my div's in my HTML. Please help me


**HTML**

<html lang="en" dir="ltr">
<link href="typewriterstyle.css" rel="stylesheet" type="text/css">

<head>
  <meta charset="utf-8">
</head>

<body>

  <div class="box">
      <div class="line-1 anim-typewriter">
          <p>OpenSource Inc.</p>
      </div>
      <div id="fadein">
          <p> Live to Code </p>
      </div>
      <img src="imagemap1.5.jpg" alt="Image" class="fadeImage" width="100%" height="100%" />
  </div>

</body>
</html>

**CSS**

html{
  min-height: 100%;
  overflow: hidden;
}
body{
  height: calc(100vh - 8em);
  padding: 0em;
  color: rgba(255,255,255,.75);
  font-family: 'Monotype Corsiva', monospace;
  background-color: rgba(0, 0, 0, 0.97);

}
.line-1{
    position: relative;
    top: -50%;
    width: 25%;
    margin: 0 auto;
    border-right: 2px solid rgba(255,255,255,.75);
    font-size: 60px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.box {

}

.fadeImage {
    -webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
}

/* Animation */
.anim-typewriter{
  animation: typewriter 1.5s steps(20) 1s 1 normal both,
             blinkTextCursor 100000ms steps(100) infinite normal;
}
@keyframes typewriter{
  from{width: 0;}
  to{width: 6em;}
}
@keyframes blinkTextCursor{
  from{border-right-color: rgba(255,255,255,.75);}
  to{border-right-color: transparent;}
}

#fadein {
  position: relative;
  top: 25%;
  width: 50%;
  margin: 0 auto;
  text-align: center;
  white-space: nowrap;
  font-size: 40px;
  font-family: 'Century', monospace;
  animation: 5.5s ease 0s normal forwards 1 fadein;
  -webkit-animation: 5.5s ease 0s normal forwards 1 fadein;
}

@keyframes fadein {
    0% {opacity: 0;}
    66% {opacity: 0;}
    100% {opacity: 1;}
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
  0% {opacity: 0;}
  66% {opacity: 0;}
  100% {opacity: 1;}
}


What I have tried:

i've tried adjusting myself and editing the .box section in the css file.
Posted
Comments
Sunasara Imdadhusen 18-Apr-18 3:29am    
It would be great if you can share some screen shots. Like what it's display using this code and what exactly you would.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900