【问题标题】:Can anyone tell me why the second "here" link doesn't work?谁能告诉我为什么第二个“这里”链接不起作用?
【发布时间】:2015-10-26 05:41:49
【问题描述】:

this 页面上,同一行上有两个“此处”链接,第二个无效。

我的 css 可以在 here 找到。我不确定为什么它与“标题”div 有什么不同,因为标题 div 中的链接即使在同一行上也能正常工作。

有问题的具体代码发布在下面。

CSS

#body {
        line-height:1.5em;
    width:700px;  
    margin:auto; 
    overflow-x: hidden; 
    padding:12.5px;
    color:#4e443c;
    font-size:16px;
    font-family:"Courier";
        text-align:left;
}

HTML

 <div id="body">
            <h3>Logger</h3>
                Logger is a java library that allows you to log to a log file easily. <a href="Logger.jar">Download</a> <span> the .jar file and then add it to your build path. 
                For Eclipse instructions see <a href="http://stackoverflow.com/a/2727723">here</a>. 
                For command-line instructions see <a href="http://stackoverflow.com/a/2096298">here</a>. 
                Then add the code <i>Logger log = new Logger();</i> to your class to initialize the logger and then you can use either <i>log.log(String);</i> or <i>log.logAndPrint(String);</i> to print to the log. 
                The <i>logAndPrint</i> method prints to the console as well as the log file while the <i>log</i> method only prints to the file. 
                Below is an example driver program. <br>
                <script src="http://gist-it.appspot.com/https://github.com/dummycode/Logger/blob/master/Example.java?footer=0">
</script>
                        <a href="/p">Back</a>
        </div>

我尝试了不同的方法,例如 display:inline-block 或使用 span 标记,但其中大部分都弄乱了我的页面格式。

谁能帮帮我?

【问题讨论】:

标签: html css hyperlink


【解决方案1】:

因为social id div 位于该链接之上。 你需要改变那只推特鸟的位置。

将以下样式添加到社交 id div:

#social {
    z-index: -1;
}

【讨论】:

    【解决方案2】:

    请检查您的 CSS 代码

    #social {
    position:fixed;
    width:70px;
    height:130px;
    left:80%;
    padding-left:100px;
    margin: 0px auto;
    }
    

    减少padding-left:100px; 的填充并使其变为left:80%;,这对你来说没问题

    【讨论】:

    • 该死,我以为我已经完成了所有工作。我几乎不知道这是一个完全不同的领域引起的问题。
    【解决方案3】:

    不要为此使用固定位置。尝试这个。

        #body {
          line-height: 1.5em;
          width: 700px;
          margin: auto;
          overflow-x: hidden;
          padding: 12.5px;
          color: #4e443c;
          font-size: 16px;
          font-family: "Courier";
          text-align: left;
          float: left;
        }
        #social {
          width: 70px;
          height: 130px;
          margin: 0px auto;
          float: left;
        }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-08
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 2010-12-12
      • 2017-04-06
      • 1970-01-01
      相关资源
      最近更新 更多