Click here to Skip to main content
15,886,873 members

Want to add an h2 tag into a div HTML

Member 14151982 asked:

Open original thread
So i'm building an portfolio for myself, but I just cannot put the second h2 tag in the center of the div..

This is what the end result should look like:
Photo — imgbb.com[^]

This is the original photo:
face — imgbb.com[^]

I hope someone can help

What I have tried:

/*Index.html*/

<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">
    <link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet'>
    <title>Debaveye Elias</title>
  </head>
  <body>
    <div class="head">
      <img src="images/face.jpg" id="face" alt="">
      <h1 class="head">Debaveye Elias</h1>
      <h2 class="head" >A C# software developer</h2>
    </div>
  </body>
</html>



/*Style.css*/

@import url(https://fonts.googleapis.com/css?family=Raleway);

div.head img#face {
  width: 450px;
  height: 450px;
}
div.head {
  background: rgba(187, 200, 133, 1);
  margin: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  position: center;
  width: 1088px;
  height: 450px;
}
div.head h1{
  display: inline-block;
  font-family: Raleway;
  color: #FFF;
  font-size: 70px;
  overflow: hidden;
  padding-left: 65px;
  padding-bottom: 187px;
  font-weight: lighter;
}

div.head h2 {
  display: inline-block;
  margin-top: 0px;
  font-family: Raleway;
  color: #000;
  font-size: 50px;
  font-weight: lighter;
}
Tags: CSS, HTML

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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