css vertical-align not working -
please vertically align tittle. seems not working properly.
<html> <body> <head> <style type="text/css"> html * { margin: 0px; padding: 0px;} .title { width: 50%; display:inline-block; vertical-align:middle; text-align: center; font-weight: bold; font-size: larger; border: solid; border-width: thin; } .btn{ color:white; background-color:#8cc152; margin: 0px !important; width: auto; display: inline-block; padding: 6px 12px; margin-bottom: 0px; font-size: 14px; font-weight: 400; line-height: 1.42857; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -moz-user-select: none; background-image: none; border: 1px solid transparent; } .btn:hover{ background-color:#a0d468; } .btn-next{ border-radius: 4px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; float:right; } .btn-prev{ border-radius: 4px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; float:left; } </style> </head> <div class='title'> <p> title <a href='?m=1'><span class='btn btn-prev'>left</span></a> <a href='?m=2'><span class='btn btn-next'>right</span></a> </p> </div> </body> </html>
set line-height
paragraph
p { line-height: 32px; vertical-align: middle; }
p { line-height: 32px; vertical-align: middle; }
<head> <style type="text/css"> html * { margin: 0px; padding: 0px; } .title { width: 50%; display: inline-block; vertical-align: middle; text-align: center; font-weight: bold; font-size: larger; border: solid; border-width: thin; } .btn { color: white; background-color: #8cc152; margin: 0px !important; width: auto; display: inline-block; padding: 6px 12px; margin-bottom: 0px; font-size: 14px; font-weight: 400; line-height: 1.42857; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -moz-user-select: none; background-image: none; border: 1px solid transparent; } .btn:hover { background-color: #a0d468; } .btn-next { border-radius: 4px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; float: right; } .btn-prev { border-radius: 4px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; float: left; } </style> </head> <div class='title'> <p> title <a href='?m=1'><span class='btn btn-prev'>left</span></a> <a href='?m=2'><span class='btn btn-next'>right</span></a> </p> </div> </body> </html>
Comments
Post a Comment