You don’t have to know a ton of Cascading Style Sheet (CSS )to make forms look nicer on a web page. Let’s take a recent simple script I created. It’s a simple auction display script written in PHP. The version without any styling is shown below:

Notice the forms look pretty plain. We can add styling to each input form like this:
<input type=“submit” value=“New bid”
style=“font-family: Arial; font-size: 8pt; color: #FFFFFF;
font-weight: bold; background-color: #000080″/>
STYLING A TEXT INPUT (dark green background, white text)
<input type=“text” name=“bid”
style=“font-family: Arial; font-size: 8pt; color: #FFFFFF;
font-weight: bold; background-color: #005F04″/>
STYLING A TEXT INPUT (dark blue background, white text)
<input type=“text” name=“email_bidder”
style=“font-family: Arial; font-size: 8pt; color: #FFFFFF;
font-weight: bold; background-color: #000080″/>

Getting better, but there is still spacing between the form in the Internet Explorer browser between the rows which needs to be removed. Also, it would be wasteful to include the style in each input box repeatedly on the page. So let’s create a small bit of CSS to handle these three conditions.
<title>A very simple auction script</title>
<style TYPE=“text/css”>
form { margin: 0; padding: 0 }
.bidback {
font-family: Arial; font-size: 8pt; color: #FFFFFF; font-weight: bold; background-color: #005F04
}
.bidreg {
font-family: Arial; font-size: 8pt; color: #FFFFFF; font-weight: bold; background-color: #005F04
}
</style>
</head>
The .bidreg class will be used for the submit input field and the email text input field. The form { margin: 0; padding: 0 } removes the spacing around the closing FORM tag. The new HTML input looks like this:
And looks like this:

Additionally, it might be nice to put the output in a table so it is more evenly aligned, but I’ll leave that to readers.

[…] Does this disrupt the RSS reading experience? One of my biggest concerns with using ads in RSS was that the reading experience would be too disrupted. I respect publisher’s wanting to be paid for their content, but I do not like being abused by advertisements trying to read the content; it’s a very delicate balance. I think this might have something to do with why some people trying other RSS ads were experiencing poor clickthru ratios because they overdid the experience. Being a firm believer in ads in moderation, I wanted to see what this experience would be like — as a reader — in several different RSS readers. So I fired up several different RSS readers to check out this feed […]
on November 16th, 2005 at 11:21 am | #Link CommentWhy not carry CSS one step further and position the form rather than recommending that the reader resort to tables for positioning?
on November 22nd, 2005 at 11:07 am | #Link CommentThat’s a good alternative suggestion, Kenoli.
on November 22nd, 2005 at 7:05 pm | #Link Comment