Jump to content

CSS forms


Fukushousha

Recommended Posts

Hello all,I have been trying to find a standard way to position forms with CSS without using tables. I found this while searching. I really liked the simplicity of it. The problem is though that .... I did not understand how it does what it does. Can anyone help explaining. The part I don't understand is what clear: left of the <br /> does, since that must be the trick. Also since I don't understand how it works I do not know how to apply it in more complicated forms, like the one in my site where some lines of the forms have multiple radio buttons in one row. Would putting them in a <p> </p> and then position it the same way as an element work? Thanks in advance for any answers people! My main concern is understanding how the above method in the link I posted works :)

Link to comment
Share on other sites

You need an element to clear the line right after the input element.They used a <br>. You can use a <span> or anything else, but it has to go right after the <input> element.The CSS clear property clears all elements that have been floated, it means that the next element will go below, and not next to, the floated elements.

Link to comment
Share on other sites

I write my pages in HTML, therefor I don't need to close tags like <img>, <link>, <meta>, <hr> or <br>.Of course, if you're writing your pages in XHTML, obviously you'll have to close your tags properly.

Link to comment
Share on other sites

Thanks for the input people. I will experiment with other ways to make it work too I guess, find which is the best for me. So for example if I wanted many rows of radio buttons, each row having 4 buttons I would put the radio buttons in a tag ... <p></p> for example and then put the element which clears the left float?On another note ... and since I would not like to make a new topic, another thing has been bothering me for a while. I create backgrounds for each of my divs and add it via css. But what if a div gets bigger for certain pages and smaller for others? For example in the index page the center of page div would be small with just some info about the page. On the other hand on the registration form page it would be quite bigger vertically. How do I achieve this without making a huge background from the start and putting it in the css?(which ends up with every page having a big background) I guess what I am asking is a way to have a dynamic background ....

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...