【问题标题】:Hyperlinks disappearing超链接消失
【发布时间】:2010-10-17 02:35:29
【问题描述】:

这很奇怪,我以前从未见过,也许我的电脑需要重新启动,但是:我在网页上添加的每个链接都消失了。你可以看到一个活生生的例子here

这是我的样式表:

/*------- UNIVERSAL -------*/
body
{
    background: #333333;
    color: #222222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.tleft { text-align: left; }
.tright { text-align: right; }

a
{
    text-decoration: none;
    color: #e6267c;
    font-weight: bold;
}

a :hover{ border-bottom: 1px #e6267c dashed; }

/*------- PAGE PARTS -------*/
#container
{
    position: relative;
    margin: 0 auto;
    width: 760px;
    padding: 0 70px 0 70px;
    background: url(images/background.png);
}

#top { height: 141px; }


/*------- TOP -------*/
#logo
{
    background: url(images/logo.png);
    display: block;
    width: 263px;
    height: 141px;
    position: absolute;
    top: 0;
    left: 50px;
    text-indent: -9000px;
}

#addjoke
{
    background: url(images/addjoke.png) bottom left;
    display: block;
    width: 242px;
    height: 65px;
    position: absolute;
    top: 0;
    left: 360px;
    text-indent: -9000px;
}

#addjoke:hover { height: 95px; }

#quickbar
{
    background: url(images/quickbar.png);
    width: 160px;
    height: 69px;
    position: absolute;
    top: 0;
    left: 670px;
}

#quickbar form, a { display: none; }


/*------- MENU -------*/
#menu
{
    color: white;
    background: url(images/menumiddle.png) repeat-y;
    float: left;
    width: 207px;
}

#menu div.box
{
    margin-left: 20px;
    margin-right: 28px;
}

#menu span.top
{
    margin: 0;
    display: block;
    height: 10px;
    background: url(images/menutop.png);
}

#menu span.bottom
{
    margin: 0;
    display: block;
    height: 10px;
    background: url(images/menubottom.png);
}

#menu h2
{
    margin: 0;
    height: 31px;
    text-indent: -9000px;
}

#menu ul li
{
    padding-left: 15px;
    background: url(images/menubullet.png) left 4px no-repeat;
}

/*navigation*/
#navigation { background: url(images/navigation.png); }


/*youraccount*/
#youraccount { background: url(images/youraccount.png); }
img.avatar
{
    float: left;
    margin-right: 10px;
}
#menu_login { clear: both; margin-top: 20px; margin-bottom: 20px; }
#menu_login input
{
    padding: 2px 5px 2px 5px;
    color: white;
    background: black;
    border: 2px solid white;
    width: 145px;
}
#menu_login label.label_password { display: block; margin-top: 10px; }
#menu_login div
{
    margin-top: 5px;
    text-align: right;
}
#menu_login button
{
    text-indent: -9000px;
    border: 0;
    width: 57px;
    height: 28px;
    background: transparent url(images/loginbutton.png);
    cursor: pointer;
  cursor: hand;

}
#menu_login label
{
    font-weight: bold;
}


/*toprated*/
#toprated { background: url(images/toprated.png); }

/*newsletter*/
#newsletter { background: url(images/newsletter.png); }

/*recentcomments*/
#recentcomments { background: url(images/recentcomments.png); }


/*------- FOOTER -------*/
#footer
{
    background: url(images/footer.png);
    width: 779px;
    height: 57px;
    margin: 0 auto;
}

这是我的 XHTML(目前还不完整):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>

        <title>Conforming XHTML 1.0 Strict Template</title>
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="author" content="" />
        <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />

        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css" /> 
        <link rel="stylesheet" type="text/css" href="stylesheet.css" />

    </head>

    <body>

        <div id="container">

            <div id="top">

                <a id="logo" href="http://superfunnyjokes.net/">SuperFunnyJokes.Net</a>
                <a id="addjoke">Add Joke</a>
                <div id="quickbar">

                    <form action="http://superfunnyjokes.net/search/" method="post">

                        <input type="text" name="query" />
                        <input type="submit" value="Search" />

                    </form>

                    <a href="http://superfunnyjokes.net/rss/">RSS Feed</a>

                </div>

            </div>

            <div id="menu">

                <!-- span for top of menu, replace with jquery -->
                <span class="top"></span>

                <h2 id="navigation">Navigation</h2>

                <div class="box">

                    <ul>

                        <li><a href="http://superfunnyjokes.net/">Home</a></li>
                        <li><a href="http://superfunnyjokes.net/categories/">Joke Categories</a></li>
                        <li><a href="http://superfunnyjokes.net/random/">Random Joke</a></li>
                        <li><a href="http://superfunnyjokes.net/members/registration/">Become A Member</a></li>
                        <li><a href="http://superfunnyjokes.net/add/">Add A Joke</a></li>

                    </ul>

                </div>

                <h2 id="youraccount">Your Account</h2>

                <div class="box">

                    <img class="avatar" src="images/noavatar.png" />
                    <p>Welcome back! You are not signed in.</p>

                    <form id="menu_login" action="http://superfunnyjokes.net/members/login.php" method="post">

                        <label for="menu_username">Username:</label>
                        <input id="menu_username" type="text" name="username" />
                        <label class="label_password" for="menu_password">Password:</label>
                        <input id="menu_password" type="password" name="password" />

                        <div><button type="submit">Login</button></div>

                    </form>

                </div>

                <h2 id="toprated">Top Rated Jokes</h2>

                <div class="box">

                    <ul class="ordered">

                        <li><a>The Werewolf and Me</a></li>
                        <li><a>Erection</a></li>
                        <li><a>The Werewolf and Me</a></li>
                        <li><a>Erection</a></li>
                        <li><a>The Werewolf and Me</a></li>             

                    </ul>

                </div>

                <h2 id="newsletter">Newsletter</h2>

                <div class="box">

                    <form id="menu_newsletter" action="http://superfunnyjokes.com/newsletter/register.php" method="post">

                        <table>
                            <tr>
                                <td><label for="menu_email">Email:</label></td>
                                <td><input id="menu_email" type="text" name="email" /></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><button type="submit">Sign Up</button></td>
                            </tr>

                        </table>

                    </form>

                </div>

                <h2 id="recentcomments">Recent Comments</h2>

                <div class="box">

                    <ul class="nobullet">

                        <li><strong>andworth:</strong> haha I really like that one</li>
                        <li><strong>andworth:</strong> haha I really like that one</li>
                        <li><strong>andworth:</strong> haha I really like that one</li>
                        <li><strong>andworth:</strong> haha I really like that one</li>
                        <li><strong>andworth:</strong> haha I really like that one</li>

                    </ul>

                </div>
            <!-- span for bottom of menu, replace with jquery -->
            <span class="bottom"></span>

            </div>

            <div id="main">

                <h2 class="sifr">THE WEREWOLF AND ME</h2>

                <p class="joke">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam blandit est eu lectus. Sed augue tortor, vehicula in, condimentum eget, tempor in, lectus. Integer enim leo, aliquam eget, hendrerit vel, laoreet a, turpis. Quisque sit amet ligula at quam condimentum ultricies. Sed molestie dolor non tellus. Vestibulum luctus nisi eget metus. Integer semper vestibulum nisl. Proin vel libero ac justo euismod sollicitudin. Duis a ligula sit amet quam fermentum convallis. Quisque tempus iaculis risus. Cras et libero vehicula lorem ultrices volutpat. Mauris quam quam, blandit et, facilisis in, sodales nec, libero. In massa tellus, varius non, luctus eu, facilisis rutrum, odio. Vivamus congue lacus quis metus.
                    <br /><br />
                    Nunc ultrices nisi ut tellus. In placerat tempus quam. Nulla dolor nulla, dictum eget, auctor a, rutrum sit amet, ante. Sed scelerisque est. Vestibulum arcu purus, dignissim nec, rhoncus id, sodales eu, quam. Nullam congue hendrerit enim. Phasellus risus. Pellentesque lacus sem, luctus tempus. 
                </p>

                <div id="jokedetails">

                    <table>
                        <tr>
                            <td>Submitted By:</td>
                            <td>admin</td>
                        </tr>
                        <tr>
                            <td>Date Submitted:</td>
                            <td>26/2/09</td>
                        </tr>
                        <tr>
                            <td>Views:</td>
                            <td>1891</td>
                        </tr>
                        <tr>
                            <td>Average Rating:</td>
                            <td>4.5 / 5</td>
                        </tr>
                    </table>

                    <form action="http://superfunnyjokes.net/process/rating.php" method="post">

                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 
                        <input name="starrating" type="radio" class="star {split:2}" /> 

                    </form>

                </div>

                <h2 id="comments">Comments</h2>

                <div class="comment">

                    <div class="left">
                        <img src="http://superfunnyjokes.net/members/avatars/noavatar.png" alt="No Avatar" />
                    </div>

                    <div class="right">

                        <h3>Ryan Polosky</h3>
                        <span>12 March 09</span>
                        <p>I found that joke really funny!</p>

                    </div>

                </div>

                <div class="comment">

                    <div class="left">
                        <img src="http://superfunnyjokes.net/members/avatars/noavatar.png" alt="No Avatar" />
                    </div>

                    <div class="right">

                        <h3>Laura Brauman</h3>
                        <span>12 March 09</span>
                        <p>Nunc ultrices nisi ut tellus. In placerat tempus quam. Nulla dolor nulla,
                        dictum eget, auctor a, rutrum sit amet, ante. Sed scelerisque est.
                        Vestibulum arcu purus, dignissim nec, rhoncus id, sodales eu, quam. Nullam
                        congue hendrerit enim. Phasellus risus. Pellentesque lacus sem, luctus
                        tempus.</p>

                    </div>

                </div>

                <div class="comment">

                    <div class="left">
                        <img src="http://superfunnyjokes.net/members/avatars/noavatar.png" alt="No Avatar" />
                    </div>

                    <div class="right">

                        <h3>James Brauman</h3>
                        <span>10 March 09</span>
                        <p>Haha! Good stuff!</p>

                    </div>

                </div>

                <h2 id="postcomment">Post Comment</h2>

                <div class="postcomment">

                    <div class="left">
                        <img src="images/noavatar.png" alt="No Avatar" />
                    </div>

                    <div class="right">

                        <table>
                            <tr>
                                <td><label for="commentname">Your Name:</label></td>
                                <td><input id="commentname" type="text" name="commentname" /></td>
                            </tr>
                            <tr>
                                <td colspan="2"><textarea cols="0" height="0"></textarea></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><button type="submit">Post</button></td>
                            </tr>

                        </table>

                    </div>

                </div>

            </div>

            <div id="footer">

            </div>
        </div>

    </body>
</html>

“导航”标题下的整个&lt;ul&gt; 正在消失,因为它充满了超链接。

【问题讨论】:

  • 一些建议:将您的代码示例缩减到使问题可见所需的最低限度。人们根本没有时间涉足这么多 HTML 和 CSS。您还应该提及您在哪个浏览器中看到问题。
  • 天哪,我从 Jeff 那里得到了 +1!这值一千个声望,对吧?
  • 提示:使用 Firefox 结合 Firebug (getfirebug.com) 测试您的网站!

标签: html css stylesheet hyperlink


【解决方案1】:

这条线让他们失望了:

#quickbar form, a { display:none; }

【讨论】:

    猜你喜欢
    • 2016-11-09
    • 1970-01-01
    • 1970-01-01
    • 2015-06-26
    • 1970-01-01
    • 1970-01-01
    • 2012-07-20
    • 2019-04-17
    • 2014-06-15
    相关资源
    最近更新 更多