PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 18, 2022

[FIXED] why does line-height vertically align li's

 November 18, 2022     css, html, vertical-alignment     No comments   

Issue

why does adding css to li line-height:15vw center the li text whereas vertical-align:middle doesn't do anything

div{
background-color:black
}
li{
display:inline-block;
color:white;
text-decoration:none;

}
ul{
height:15vw;
}
<div>
   <ul>
      <li>home</li>
      <li>reset</li>
   </ul>

</div>


Solution

The vertical-align property can be used in two contexts: A. To vertically align an inline element's box inside its containing line box. B. To vertically align the content of a cell in a table.

Read more here:

https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align



Answered By - A. Meshu
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing