2

アクティブなタブの下に矢印の形を追加するにはどうすればよいですか?

.nav-tabs2 .active { background-image:url(http://www.asiarooms.com/assets/themes/v1/images/areas/details/menu-arrow.png); background-repeat:no-repeat; background-position:bottom center; }

http://jsfiddle.net/DJHZb/13/

<div class="box-head tabs">
  <ul class="nav2 nav-tabs2">
   <li class="active">
    <a href="#0" data-toggle="tab" class="firstelement">Active Tab</a></li>
   <li><a href="#1" data-toggle="tab">Inactive Tab</a></li>
   <li><a href="#2" data-toggle="tab">Inactive Tab #2</a></li>
  </ul>
</div>
4

3 に答える 3

9

「css吹き出し」を見てください。考え方は同じです:http://nicolasgallagher.com/pure-css-speech-bubbles/demo

疑似css::afterと::before(一部のIEでは機能しません)と境界線をいじって、互いに重なり合う正方形または三角形を作成する必要があります。

例:

.active::after {
content: "";
position: absolute;
bottom: -15px;
left: 50px;
border-width: 15px 15px 0;
border-style: solid;
border-color: #F3961C transparent;
display: block;
width: 0;
}

ボックスと境界線のある三角形を作成する方法の説明は次のとおりです。http ://www.sitepoint.com/pure-css3-speech-bubbles/

于 2013-01-12T15:16:12.427 に答える
1

このようなコード(ブートストラップを使用)の場合:

<body>
  <div class="panel panel-primary">
    <div class="panel-heading" style="font-size:large">
       Klujo
    </div>

    <div class="panel-body">
        <div class="wizard">
            <a >
                Step 1<br>
        Authorize the app
            </a>
            <a class="active">
                Step 2<br>
        Post your jobs
            </a>

        </div>
   </div>

  </div>
</body>

次のようにcssを使用できます。

.wizard a {
    background: #efefef;
    display: inline-block;
    margin-right: 5px;
    min-width: 150px;
    outline: none;
    padding: 10px 40px 10px;
    position: relative;
    text-decoration: none;
}

.wizard .active {
    background: #007ACC;
    color: #fff;
}

.wizard a:before {
    width: 0;
    height: 0;
    border-top: 25px inset transparent;
    border-bottom: 35px inset transparent;
    border-left: 20px solid #fff;
    position: absolute;
    content: "";
    top: 0;
    left: 0;
}

.wizard a:after {
    width: 0;
    height: 0;
    border-top: 35px inset transparent;
    border-bottom: 25px inset transparent;
    border-left: 21px solid #efefef;
    position: absolute;
    content: "";
    top: 0;
    right: -20px;
    z-index: 2;
}

.wizard a:first-child:before,
.wizard a:last-child:after {
    border: none;
}

.wizard a.active:after {
    border-left: 21px solid #007ACC;
}

望ましい結果を得るために

于 2015-06-03T10:10:42.820 に答える
0
  </body>   
  <style>   
    .tool {
     position: relative;
     display: inline-block;
     border-bottom: 1px dotted red;
     }

   .tool .text {
    visibility: hidden;
    width: 100%;
    background-color: blue;
    color: white;
    text-align: center;
    border-radius: 5px;
    padding: 5px 0;
    position: absolute;

    top: -1px;
     left: 110%;
     }

    .tool .text::after {
     content: "";
      position: absolute;
      top: 10%;
      right: 99%;
       margin-top: -2px;
      border-width: 5px;
      border-style: solid;
      border-color: transparent blue transparent transparent;
      }
     .tool:hover .text {
     visibility: visible;
       }
     </style>   

     <div class="tool">Mouse Hover
      <span class="text">I Can pop up on the right side of these   words</div>
      </body>
于 2017-02-12T18:49:23.417 に答える