将标头固定为特定站点中的静态

时间:2015-10-19 08:34:29

标签: php html css

首先让我说我基本上不懂HTML或CSS,我只是想乱搞。 其次我讨厌固定标题,这似乎是那里的“新规则”,特别是在新闻和购物网站。所以我在Firefox中使用Stylish来使标题保持静态,特别是在具有可笑的大标题的网站中,我发现它在大多数情况下相当容易。例如for this site 我用

@-moz-document domain('gigabyte.com') {
    #div_main {
        position: static !important;
    }
}

我对我经常访问的所有网站都做了类似的事情并且有“浪费空间”的标题,但我无法让它工作for this site。是否可以通过Stylish或任何其他方式更改它?

提前谢谢大家。

1 个答案:

答案 0 :(得分:0)

您使用的是哪种文本编辑器?因为我使用notepad ++并且我基本上创建了一个头文件广告,只需在html代码的顶部调用它,例如:

HEADER.PHP文件

<html>

<head>
</head>

<body>

<div class="login" style="width:101%;">
    Username: <input type="text" name="uname"><br>
    Password: <input class="align" style="margin-left:3px;" type="password" name="pword"><br>
    <input class="button" type="button" onclick = "location.href = 'registration.php'" name="signin" value="Sign In">
    <a href = "registration.php"><input  class="button" type="button" name="register" value="Sign Up"></a>
    <center>
    <img src = "img/LOGO.jpg" style = "height: 80px; margin-top: -80px; width: 510px;">
    </center>
</div>

<center>
<div class="nav">
    <ul>
        <li><button onclick = "location.href = 'welcome.php'"><a href="welcome.php">Welcome</a></button></li>
    </ul>

    <ul>
        <li><button onclick = "location.href = 'hotel.php'"><a href="hotel.php">Hotel</a></button></li>
    </ul>

    <ul>
        <li><button onclick = "location.href = 'room.php'"><a href="Room.php">Rooms</a></button></li>
    </ul>

    <ul>
        <li><button onclick = "location.href = 'contactus.php'"><a href="contactUs.php">Contact Us</a></button></li>
    </ul>

    <ul>
        <li><button onclick = "location.href = 'gallery.php'"><a href="gallery.php">Gallery</a></button></li>
    </ul>
</div>
</center>

</body>
</html>

我使用这个PHP代码将该文件调用到我的其他页面:

<?php
    include('templates/header.php');
?>

我的标题只是停留在页面的顶部我不知道我是否理解你想要发生什么,但这是我的猜测希望它能帮助FYI我只是一个新手:)