HTML forms are fantastically useful things, but by default they tend to look like something only a mother could love. Fortunately, with the aid of CSS, you can really transform the look of an HTML form, and make it much easier on the eye. This tutorial shows you how.
Web Development
Client and server-side programming. Covers JavaScript, PHP, Perl and ASP.
See also:Internet Explorer Conditional Comments
What are conditional comments?
Conditional comments are a simple Internet-Explorer-only feature that Microsoft added to IE5 Windows and later. (Mac IE doesn’t support them.) They provide an easy way to detect that the visitor is using an IE browser (and which version they’re using). You can then serve IE users different blocks of HTML as required.
CSS Floats
What are floats?
This box is floated right.
A float is simply a box (for example, a div
) that is shifted to the left side or the right side of its container. We then say that the box is floated left or floated right.
One of the key benefits of floats is that they allow you to have bits of content sitting side by side, rather than one below the other (much like you can do with table columns, but better!). This allows you to do cool stuff like text columns, boxouts (like the one above), and advanced positioning of your page elements.
Floats are a bit like the align="left"
and align="right"
attributes in img
elements.
Working with Strings
In this reference article we’ll explain what strings are, why they’re important, and how they work in JavaScript. We’ll cover all the properties and methods of strings, along with some simple examples.
Data Types in Perl
Like most programming languages, Perl knows about different varieties of data. In this tutorial we’ll explore the most common data types used in Perl:
- Scalars
- Arrays (lists)
- Associative arrays (hashes)
Preventing Multiple Form Submits
Forms on websites are a handy way to get information from your visitors. However it’s easy for a visitor to accidentally send more than one copy of a form by clicking on the form’s “submit” button more than once. The end result can be that identical emails get sent to the Webmaster, or identical records get added to a database.
This handy little tutorial shows how you can use JavaScript in your Web pages to avoid forms being submitted more than once by a visitor.
Controlling Program Flow
Normally when you run a Perl script, the computer moves through each line of your script in turn, executing each line as it goes. However, often you’ll want to alter this flow through the script.
For example, you might want to run different pieces of code depending on whether a visitor has filled out a form correctly or not. Also, you often want to run the same piece of code lots of times – for example, when reading through each line of a file.
Perl features a number of useful ways to alter the path of execution through your script. In this tutorial I’ll show you the most common techniques, and how you can use them.
Fun with Random Numbers
We can use JavaScript to generate random numbers, that is, numbers that are different each time the script is run. This allows us to do all sorts of fun stuff, such as:
- Show a random image or piece of text on the page
- Make a link that links to a random page
- Create games that people can play in their browser
First, let’s look at how we can create a random number in JavaScript.
[Read more…] about Fun with Random Numbers
HTML Links for Beginners
HTML links allow one Web page to link to other related pages. They can use text or images to link to other Web pages or even an email address. If you’re new to Web building and you’re not sure how links work in HTML pages, this tutorial is for you! Read on…
Making Lists Look Nicer with CSS
Standard HTML lists are usually pretty boring – a few indented lines with bullets or numbers down the left side. However, with the power of CSS, you can really get creative with your lists! Read on for details…