0

Thats not a div I want I just cant get to post it because it does not meet some requirement. I have never used anything like that before, just need help for a college project that requires programming. I have this: enter image description here

I just want the text to be centered. jsfiddle .net /etr1ok47/#&togetherjs=VfasppUOxh

  • Usually , you can adjust the `line-height` or `padding-top` in order to make it centralized vertically . – Ashraf Jul 03 '18 at 03:36

4 Answers4

1

using flex in this-p class:

display: flex;
flex-direction: column;
justify-content: center;
DucCM
  • 21
  • 3
0

You can add padding to the top of your p element in css if you are needing the words in the circle to be vertically better centered.

p.this-p{
    vertical-align: middle;
}

If the problem is the p itself not centering in the li element then define the parent with display: table and the element itself with vertical-align: middle and display: table-cell

OneLiner
  • 521
  • 2
  • 6
0

Try applying the following to your containing div (.parent) and the wrapper around your text (.child).

.parent {
  height: 300px;
  line-height: 300px;
  text-align: center;
}
.child {
  line-height: normal;
  display: inline-block;
  vertical-align: middle;
}
Steve Mulvihill
  • 680
  • 5
  • 13
-1

p.this-p{ vertical-align: middle; align: center}

Above is when you use p element with padding. Same is applicable for other element

rkoots
  • 319
  • 3
  • 4