2016-04-26 14 views
0

ページのナビゲーターは透過的ではありません。ページの特定の位置にリンクするたびに、テキストの一部がナビゲータに表示されなくなります。下図のように示す: enter image description hereページの特定の部分に上マージンでリンクします

私が欲しいのです: enter image description here

あなたが最初の写真で、「背景」のナビゲーターの内側に隠されていることがわかります。ここで

は私のコードです:

<!DOCTYPE html> 
    <html> 
    <head> 
    <style> 
    ul { 
     position: fixed; 
     top: 0; 
     width: 100%; 
     background-color: rgb(255, 255, 255); 
     opacity: 1.0; 
     list-style-type: none; 
     margin: 0; 
     padding: 0; 
     overflow: hidden; 
     -moz-box-shadow: 0px 2px 20px -5px rgba(0, 0, 0,0.5); 
     -webkit-box-shadow: 0px 2px 20px -5px rgba(0, 0, 0, .5); 
     box-shadow: 0px 2px 20px -5px rgba(0, 0, 0, .5); 
     padding: 5px; 
    } 
    li { 
     float: right; 
    } 
    li a { 
     display: block; 
     color: black; 
     text-align: center; 
     padding: 14px 25px; 
     text-decoration: none; 
    } 
    li a:hover { 
     font-family: cursive; 
    } 

    h2 { 
     font-size: 30px; 
     font-family: Futura, Trebuchet MS, Arial, sans-serif; 
    } 

    h3 { 
     font-size: 30px; 
     font-family: Brush Script MT, cursive; 
    } 

    h2, h3 { 
     width: 50%; 
     height: 60px; 
     margin: 0; 
     padding: 0; 
     display: inline; 
    } 
    </style> 
    </head> 

    <body> 
     <header id="header"> 
     <ul> 
      <li><a href="#experience">Experience</a></li> 
      <li><a href="#background">Background</a></li> 
      <li><a href="#home">Home</a></li> 
     </ul> 
     </header> 

     <!-- Home --> 
     <table align="center" border="0" cellpadding="5" cellspacing="5", width="450", style="margin-top:100px"> 
     <tr id="home"> 
     <!--<section id="home"> --> 
     <td> 
      <div id="image"> 
       <img src="" style="margin:auto;width:150px;height:200px;display:block" /> 
      </div> 
     </td> 
     <td> 
      <div id="section"> 
      <h2> sss </h2> 
      <h3>sss</h3> 
       <p>ssssssss</p> 
      </div> 
     </td> 
     <!--</section>--> 
     </tr> 
     <!-- Background --> 
     <tr id="background"> 
     <td colspan="2"> 
     <!--<section id="background">--> 
      <div id="background1"> 
      <h2 style="font-family: Futura, Trebuchet MS, Arial, sans-serif;"> Background </h2> 
      <p>Big Star was an American power pop band formed in Memphis, Tennessee, in 1971 by Alex Chilton, Chris Bell, Jody Stephens, and Andy Hummel. The group broke up in 1974, but reorganized with a new line-up nearly 20 years later. In its first era, the band's musical style drew on the vocal harmonies of The Beatles, as well as the swaggering rhythms of The Rolling Stones and the jangling guitars of The Byrds. To the resulting power pop, Big Star added dark, existential themes, and produced a style that foreshadowed the alternative rock of the 1980s and 1990s. Their first two albums, #1 Record and Radio City, suffered from ineffective marketing but garnered enthusiastic reviews; Rolling Stone called the band a "quintessential American power pop band" that was "one of the most mythic and influential cult acts in all of rock & roll". In 1993, Chilton and Stephens re-formed Big Star with Jon Auer and Ken Stringfellow. After tours in Europe and Japan, they released a new studio album, In Space, in 2005. Big Star was inducted into the Memphis Music Hall of Fame in 2014. (Full article...)Big Star was an American power pop band formed in Memphis, Tennessee, in 1971 by Alex Chilton, Chris Bell, Jody Stephens, and Andy Hummel. The group broke up in 1974, but reorganized with a new line-up nearly 20 years later. In its first era, the band's musical style drew on the vocal harmonies of The Beatles, as well as the swaggering rhythms of The Rolling Stones and the jangling guitars of The Byrds. To the resulting power pop, Big Star added dark, existential themes, and produced a style that foreshadowed the alternative rock of the 1980s and 1990s. Their first two albums, #1 Record and Radio City, suffered from ineffective marketing but garnered enthusiastic reviews; Rolling Stone called the band a "quintessential American power pop band" that was "one of the most mythic and influential cult acts in all of rock & roll". In 1993, Chilton and Stephens re-formed Big Star with Jon Auer and Ken Stringfellow. After tours in Europe and Japan, they released a new studio album, In Space, in 2005. Big Star was inducted into the Memphis Music Hall of Fame in 2014. (Full article...) 
      Big Star was an American power pop band formed in Memphis, Tennessee, in 1971 by Alex Chilton, Chris Bell, Jody Stephens, and Andy Hummel. The group broke up in 1974, but reorganized with a new line-up nearly 20 years later. In its first era, the band's musical style drew on the vocal harmonies of The Beatles, as well as the swaggering rhythms of The Rolling Stones and the jangling guitars of The Byrds. To the resulting power pop, Big Star added dark, existential themes, and produced a style that foreshadowed the alternative rock of the 1980s and 1990s. Their first two albums, #1 Record and Radio City, suffered from ineffective marketing but garnered enthusiastic reviews; Rolling Stone called the band a "quintessential American power pop band" that was "one of the most mythic and influential cult acts in all of rock & roll". In 1993, Chilton and Stephens re-formed Big Star with Jon Auer and Ken Stringfellow. After tours in Europe and Japan, they released a new studio album, In Space, in 2005. Big Star was inducted into the Memphis Music Hall of Fame in 2014. (Full article...) 
      Big Star was an American power pop band formed in Memphis, Tennessee, in 1971 by Alex Chilton, Chris Bell, Jody Stephens, and Andy Hummel. The group broke up in 1974, but reorganized with a new line-up nearly 20 years later. In its first era, the band's musical style drew on the vocal harmonies of The Beatles, as well as the swaggering rhythms of The Rolling Stones and the jangling guitars of The Byrds. To the resulting power pop, Big Star added dark, existential themes, and produced a style that foreshadowed the alternative rock of the 1980s and 1990s. Their first two albums, #1 Record and Radio City, suffered from ineffective marketing but garnered enthusiastic reviews; Rolling Stone called the band a "quintessential American power pop band" that was "one of the most mythic and influential cult acts in all of rock & roll". In 1993, Chilton and Stephens re-formed Big Star with Jon Auer and Ken Stringfellow. After tours in Europe and Japan, they released a new studio album, In Space, in 2005. Big Star was inducted into the Memphis Music Hall of Fame in 2014. (Full article...) 
      </p> 
      <hr>  
      </div> 
     <!--</section>--> 
     </td> 
     </tr> 
     </body> 
    </html> 
+0

のオフセットになるあなたは「ページの特定の位置にリンク」どのようにコードを提供することができ –

+0

私はそれが 'Backgroundだと思います' – ZigZagZebra

+0

その非表示のナビゲーションバーの位置が固定されているため、jQueryで使用することができます – ShibinRagh

答えて

1

.anchor { padding-top: 90px; } 

新しいクラスを作成して、リンク先の方の要素にこのクラスを追加します。例えば。

<div id="background1" class="anchor"> 

今、あなたは、この要素にリンクする場合、クラスは自動的

+0

私はこれが動作するとは思わない。あなたは例を挙げていただけますか? – ZigZagZebra

+0

https://jsfiddle.net/normangr7/bcjnhemy/ –

関連する問題