2016-11-17 65 views
0

目前我嘗試使用,使成形導航欄導航欄引導做形,引導

目前這是我的片斷

<div class="navbar-header"> 
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
       <span class="sr-only">Toggle navigation</span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
       <span class="icon-bar"></span> 
      </button> 
      <style> 
      </style> 
      <style> 
      #nav-brand-bg{ 
       background-color: red; 
       width: 100px; 
       height: 100px; 
       position: relative; 
      } 
      </style> 
      <div id="nav-brand-bg"></div> 
      <a class="navbar-brand" href="index.html"> 
      <img src="http://smarti-oc.dev/image/templates/smarti-new-logo.png" alt=""> 
      </a> 
      <a class="navbar-brand" href="index.html"> 
      <img src="http://smarti-oc.dev/image/templates/malaysia_resize.png" alt=""> 
      </a> 
     </div> 

沒有任何鍵或線索做這個? 非常感謝球員

+0

不知道你在問什麼。你想讓導航欄形狀像圖像? – RSSM

+0

是的,這是正確的。 有什麼線索? –

回答

0

我要好好看看刺...

#nav-brand-bg { 
 
     background-color: red; 
 
     width: 100px; 
 
     height: 100px; 
 
     position: relative; 
 
    } 
 
    
 
    #navwrap { 
 
     position: absolute; 
 
     width: 90%; 
 
    } 
 
    
 
    #trapezoid { 
 
     border-top: 100px solid black; 
 
     border-left: 50px solid transparent; 
 
     border-right: 50px solid transparent; 
 
     -webkit-transform: skew(-27deg); 
 
     -moz-transform: skew(-27deg); 
 
     -o-transform: skew(-27deg); 
 
     height: 0; 
 
     width: 100px; 
 
     left: -25px; 
 
     position: relative; 
 
    } 
 
    
 
    #bar { 
 
     width: 100%; 
 
     background-color: black; 
 
     height: 40px; 
 
     position: absolute; 
 
     top: 30px; 
 
    }
<div class="navbar-header"> 
 
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
 
    <span class="sr-only">Toggle navigation</span> 
 
    <span class="icon-bar"></span> 
 
    <span class="icon-bar"></span> 
 
    <span class="icon-bar"></span> 
 
    </button> 
 

 
    <div id="nav-brand-bg"></div> 
 
    <div id="navwrap"> 
 

 
    <div id="trapezoid"> 
 

 
    </div> 
 
    <div id="bar"> 
 

 
    </div> 
 
    </div>

這使用不同的方法,但我看不到你的圖像,這看起來像你要去的嗎?

+0

我正在研究類似於梯形的東西。問題是文字不會留在其中。 – RSSM