无法移动#element1,为什么会这样?

时间:2015-05-28 14:59:56

标签: html css position absolute

我已经尝试为#element1制作一个css规则,对于所有h1等,但我仍然可以移动除#element1之外的每个对象。有什么我想念的吗?

    <style>
    h1{
        position:absolute;
        top:3000;
    }
    </style>
</head>

<body>

    <img src="http://s7.postimg.org/qk0paqnob/cooltext119178095664811.jpg">

    <h2 class="post1">Web Design</h2>
    <h2 class="post2">App Development</h2>
    <h2 class="post3">IT Consulting</h2>
    <h2 class="post4">Tech Support</h2>

    <div id="1">
        <h1 id="element1">Web Design</h1>
        <p>Gunlogson is a small developmental technology business that focused of     promotional projects for small bussinesses.</p>
    </div>

    <h1 id="element2">App Development</h1>

    <h1 id="element3">IT Consulting</h1>

    <h1 id="element4">Tech Support</h1>

</body>

1 个答案:

答案 0 :(得分:4)

您需要将其更改为3000px

h1{
    position:absolute;
    top:3000;
}

h1{
    position:absolute;
    top:3000px;
}