<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>PHP-Scripts Blog &#187; HTML</title>
	<link>http://www.php-scripts.com</link>
	<description>Writing about PHP scripting since 12/99. Learn something new every day.</description>
	<pubDate>Thu, 09 Oct 2008 14:17:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>Making multiple form output look better</title>
		<link>http://www.php-scripts.com/20051114/63/</link>
		<comments>http://www.php-scripts.com/20051114/63/#comments</comments>
		<pubDate>Mon, 14 Nov 2005 18:29:04 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=63</guid>
		<description><![CDATA[You don&#8217;t have to know a ton of Cascading Style Sheet (CSS )to make forms look nicer on a web page. Let&#8217;s take a recent simple script I created. It&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>You don&#8217;t have to know a ton of Cascading Style Sheet (CSS )to make forms look nicer on a web page. Let&#8217;s take a recent simple script I created. It&#8217;s a simple auction display script written in PHP. The version without any styling is shown below:</p>
<p><img src="http://www.php-scripts.com/images/2005/simpleauct-b4style.jpg" border="0" ALT="multiple forms in rows of data without any CSS"/></p>
<p>Notice the forms look pretty plain. We can add styling to each input form like this:</p>
<div class="codesnip-container" >
<div class="codesnip">STYLING A SUBMIT BUTTON<br />
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;submit&#8221;</span> <span class="kw3">value</span>=<span class="st0">&#8220;New bid&#8221;</span> <br />
<span class="kw3">style</span>=<span class="st0">&#8220;font-family: Arial; font-size: 8pt; color: #FFFFFF; <br />
font-weight: bold; background-color: #000080&#8243;</span>/<span class="kw2">&gt;</span></a></span></p>
<p>STYLING A TEXT INPUT (dark green background, white text)<br />
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;text&#8221;</span> <span class="kw3">name</span>=<span class="st0">&#8220;bid&#8221;</span><br />
<span class="kw3">style</span>=<span class="st0">&#8220;font-family: Arial; font-size: 8pt; color: #FFFFFF; <br />
font-weight: bold; background-color: #005F04&#8243;</span>/<span class="kw2">&gt;</span></a></span></p>
<p>STYLING A TEXT INPUT (dark blue background, white text)<br />
<span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;text&#8221;</span> <span class="kw3">name</span>=<span class="st0">&#8220;email_bidder&#8221;</span><br />
<span class="kw3">style</span>=<span class="st0">&#8220;font-family: Arial; font-size: 8pt; color: #FFFFFF; <br />
font-weight: bold; background-color: #000080&#8243;</span>/<span class="kw2">&gt;</span></a></span></div>
</div>
<p><img src="http://www.php-scripts.com/images/2005/simpleauct-wstyle1.jpg" border="0" ALT="multiple forms in rows of data without any CSS"/></p>
<p>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&#8217;s create a small bit of CSS to handle these three conditions.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>A very simple auction script<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/style.html"><span class="kw2">&lt;style</span></a> <span class="kw3">TYPE</span>=<span class="st0">&#8220;text/css&#8221;</span><span class="kw2">&gt;</span></a></span><br />
form { margin: 0; padding: 0 }<br />
.bidback { <br />
font-family: Arial; font-size: 8pt; color: #FFFFFF; font-weight: bold; background-color: #005F04<br />
}<br />
.bidreg {<br />
font-family: Arial; font-size: 8pt; color: #FFFFFF; font-weight: bold; background-color: #005F04<br />
}<br />
<span class="sc2"><span class="kw2">&lt;/style&gt;</span></span> <br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></div>
</div>
<p>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:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;text&#8221;</span> <span class="kw3">name</span>=<span class="st0">&#8220;bid&#8221;</span> <span class="kw3">size</span>=<span class="st0">&#8220;5&#8243;</span> <span class="kw3">class</span>=<span class="st0">&#8220;bidback&#8221;</span>/<span class="kw2">&gt;</span></a></span> email: <span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;text&#8221;</span> <span class="kw3">name</span>=<span class="st0">&#8220;email_bidder&#8221;</span> <span class="kw3">size</span>=<span class="st0">&#8220;15&#8243;</span> <span class="kw3">class</span>=<span class="st0">&#8220;bidreg&#8221;</span>/<span class="kw2">&gt;</span></a></span> <span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;submit&#8221;</span> <span class="kw3">value</span>=<span class="st0">&#8220;New bid&#8221;</span> <span class="kw3">class</span>=<span class="st0">&#8220;bidreg&#8221;</span>/<span class="kw2">&gt;</span></a></span></div>
</div>
<p>And looks like this:</p>
<p><img src="http://www.php-scripts.com/images/2005/simpleauct-wstyle2.jpg" border="0" ALT="multiple forms in rows of data without any CSS"/></p>
<p>Additionally, it might be nice to put the output in a table so it is more evenly aligned, but  I&#8217;ll leave that to readers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051114/63/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
