How can I make my form take only a limited space?

Ergo Proxy

HTML CODE

<ul id="cool">
    <li>
        <form action="/send.php" method="post">
            <p id="submit">XYZ
                <select name="server">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="2">2</option>
                </select>
                <br />
                <br />Nickname
                <input type="text" name="Nickname" maxlength="16" required="required" autofocus="autofocus" />Email
                <input type="email" name="Email" maxlength="254" required="required" />
                <input type="submit" value="Sumbit">
            </p>
        </form>
    </li>
</ul>

CSS Code

#submit {
    width: 125px;
    height: 135px;
    margin: 0 auto 20px;
    ul {
        list-style-type: none;
    }
    #cool:hover {
        background-image: url(nav-bg.png);
        background-repeat: no-repeat;
    }

So after trying to put a background on the code using :hover I noticed that the form width expands on the whole page while it is centered.I tried using width in the ul{} but that put my form on the left. So my question is, how to make the form not expand on the whole page?

Excuse my code, I'm only a beginner, anything else I could provide you to assist you in assisting me (irony :P) please tell me.

Mr. Alien

ul is a block level element by default, it will take up entire horizontal space on the page, so you need to assign some fixed with to your ul element, and than use margin: auto; to center the form.

ul {
    list-style-type: none;
    width: 250px; /* Approximately */
    margin: auto;
}

Demo

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How can I make my flexbox layout take 100% vertical space?

From Dev

How can i make a control to take whole space of parent in javafx?

From Dev

How do I make my text box only take numbers?

From Dev

How can I make a while loop only run a limited number of times?

From Dev

How can I make a Polymer element take up all vertical space on the page?

From Dev

How can I make a form in Chrome extension show only once?

From Dev

How can i make a button to clear one of my fields in a form?

From Dev

How can i make a login form that logs me in into my webmail?

From Dev

How can I make my form responsive on all sizes

From Dev

Android: How to make a custom view take only the available screen space?

From Dev

How can I make my character move only forward in Unity?

From Dev

How do I make my script take only numeric inputs without screwing it up

From Dev

How can I make my Form Control variables acessible to classes other than my Form class?

From Dev

Django: How can I make Form Wizard take in a request object when it creates the forms?

From Dev

How can I achieve a JFormattextfield accepting only number and limited character

From Dev

How can I make the main form align correctly after my control height is autosized and then I maximize the form?

From Dev

R gt table formatting: How can I take my long gt table and make it wide?

From Dev

How can I make my PC always take the first local IP from the WiFi router?

From Dev

How can I make my primary DNS take priority over other servers?

From Dev

How can i make my business logic only execute once, so it alters the object only once

From Dev

How can I make my select statement deterministically match only 1/n of my dataset?

From Dev

How can I make my main form wait for a result from a custom dialog that I have created?

From Dev

How can I make audio play when the button is pressed and immediately stop when I take my finger off the same button?

From Dev

How do I make my Python extension take additional arguments?

From Dev

How can I make a reset button in my C# Windows Form?

From Dev

How can i make a dynamic form in vuejs

From Dev

How can I make a form within a tooltip?

From Dev

How can I make form and buttons inline?

From Dev

how to make MediaElement to take the whole space of a Grid?

Related Related

  1. 1

    How can I make my flexbox layout take 100% vertical space?

  2. 2

    How can i make a control to take whole space of parent in javafx?

  3. 3

    How do I make my text box only take numbers?

  4. 4

    How can I make a while loop only run a limited number of times?

  5. 5

    How can I make a Polymer element take up all vertical space on the page?

  6. 6

    How can I make a form in Chrome extension show only once?

  7. 7

    How can i make a button to clear one of my fields in a form?

  8. 8

    How can i make a login form that logs me in into my webmail?

  9. 9

    How can I make my form responsive on all sizes

  10. 10

    Android: How to make a custom view take only the available screen space?

  11. 11

    How can I make my character move only forward in Unity?

  12. 12

    How do I make my script take only numeric inputs without screwing it up

  13. 13

    How can I make my Form Control variables acessible to classes other than my Form class?

  14. 14

    Django: How can I make Form Wizard take in a request object when it creates the forms?

  15. 15

    How can I achieve a JFormattextfield accepting only number and limited character

  16. 16

    How can I make the main form align correctly after my control height is autosized and then I maximize the form?

  17. 17

    R gt table formatting: How can I take my long gt table and make it wide?

  18. 18

    How can I make my PC always take the first local IP from the WiFi router?

  19. 19

    How can I make my primary DNS take priority over other servers?

  20. 20

    How can i make my business logic only execute once, so it alters the object only once

  21. 21

    How can I make my select statement deterministically match only 1/n of my dataset?

  22. 22

    How can I make my main form wait for a result from a custom dialog that I have created?

  23. 23

    How can I make audio play when the button is pressed and immediately stop when I take my finger off the same button?

  24. 24

    How do I make my Python extension take additional arguments?

  25. 25

    How can I make a reset button in my C# Windows Form?

  26. 26

    How can i make a dynamic form in vuejs

  27. 27

    How can I make a form within a tooltip?

  28. 28

    How can I make form and buttons inline?

  29. 29

    how to make MediaElement to take the whole space of a Grid?

HotTag

Archive