3
<html>
    <head>
    <style>
        .nav
        {
            height: 45px;
        }
        .btn-return
        {
            display: inline-block;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
        .btn-menu
        {
            display: inline-block;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
    </style>
    </head>
    <body>
        <div class="nav">
            <a href="#" class="btn-return">return</a>
            <a href="#" class="btn-menu"></a>
        </div>
    </body>
    </html>

enter image description here

<html>
    <head>
    <style>
        .nav
        {
            height: 45px;
        }
        .btn-return
        {
            display: inline-block;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
        .btn-menu
        {
            display: inline-block;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
     </style>
     </head>
     <body>
        <div class="nav">
            <a href="#" class="btn-return">return</a>
            <a href="#" class="btn-menu">problem</a>
        </div>
    </body>
    </html>

enter image description here

the html code is all same except there are some characters between <a href="#" class="btn-menu"></a>. I want to kown why the result is not same when there are some characters
between <a href="#" class="btn-menu"></a>.it's so stranger!,i think for a long time ,but i can't find the reason.

一无所有
  • 101
  • 8

1 Answers1

1

do you want to display buttons in one row? try this to Put buttons in one row

<html>
    <head>
    <style>
        .nav
        {
            height: 45px;
        }
        .btn-return
        {
            display: inline;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
        .btn-menu
        {
            display: inline;
            width: 43px;
            height: 100%;
            border: 1px solid red;
        }
    </style>
    </head>
    <body>
        <div class="nav">
            <a href="#" class="btn-return">return</a>
            <a href="#" class="btn-menu"></a>
        </div>
    </body>
    </html>
m.moghadam
  • 82
  • 8