Wikipedia viewer layout help

Hi, I’m just looking from input from others because my brain is a little tired right now and I’m not sure if it is or isn’t, so if you could tell me: is this page centered? When you submit a search and the results come up, are they centered? I always have an odd amount of trouble with this. Thanks!

Looks centered to me, and verified it’s centered.

Suggestion1: Use a Chrome browser plugin like Page Ruler so you can measure stuff on your screen.

Suggestion2: Detect for RETURN key press on your input box, and fire the method for Sumit button so user don’t have to click the button. They can just press ENTER after typing their query

There’s a simpler and more idiomatic way of doing this in HTML - change the <button> to <input type="submit">, wrap all the form stuff (including both the <input type="text"> and the <input type="submit">) in a <form> element, change the trigger to the submit event of the form element, and use the event.preventDefault(); method to prevent the page from reloading.

<form> element
<input> types
jQuery submit() method

The World’s Greatest Form

1 Like