Redskinsjo
Redskinsjo

Reputation: 452

Html elements don't move

I am trying to personalise a web page to move an input text element.

Here's my code:

<body>
    <h1>Todo List</h1>
    <input id="search" type="search">
    <input id='newTodo' type="text">

    <button>Add a todo</button>
    <script src="file.js"></script>
</body>




input {
    position: absolute;
    right: 0px;
    top: 0px;
}

However, nothing moves. Is that related to input elements?

Upvotes: 0

Views: 688

Answers (1)

Krzysztof Golasik
Krzysztof Golasik

Reputation: 180

It's working.

I believe you wrongly attached your styles, if code you pasted is exactly the same in your project, please try this:

<body>
    <h1>Todo List</h1>
    <input id="search" type="search">
    <input id='newTodo' type="text">

    <button>Add a todo</button>
    <script src="file.js"></script>
</body>



<style>
input {
    position: absolute;
    right: 0px;
    top: 0px;
}
</style>

Upvotes: 1

Related Questions