Home arrow HTML arrow Page 3 - Sending Email with AJAX: Building a Small Application
HTML

Sending Email with AJAX: Building a Small Application


AJAX has become ubiquitous, thanks to the fact that it gives web developers the ability to create applications that make http requests without reloading the page on which the application is running. It is also extremely versatile and powerful. This article, the first in a series, will start you on the way to creating an AJAX-based email application.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 33
January 17, 2006
TABLE OF CONTENTS:
  1. · Sending Email with AJAX: Building a Small Application
  2. · Getting started: developing the application’s user interface
  3. · Spicing things up: writing the CSS rules for the AJAX email application
  4. · Working with building blocks: defining the (X)HTML markup for the email application

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Sending Email with AJAX: Building a Small Application - Spicing things up: writing the CSS rules for the AJAX email application
(Page 3 of 4 )

To keep things really simple, the whole structure of the user interface you just saw will be comprised of only three DIV elements. The first one will be the containing block that will wrap up both the left and right panels respectively. With reference to the process for collecting message data, I’ll use only two regular forms, handy for adding new contacts as well as for sending email messages.

As you can see, the user interface utilized by the program is quite simple, so here are the CSS styles that will give the look and feel for each (X)HTML element included in the web document:

body {
            margin: 0;
            padding: 0;
}
h1 {
            font: bold 16px Arial, Helvetica, sans-serif;
            margin: 5px;
}
a:link,a:visited {
            display: block;
            width: 120px;
            padding: 2px 0 2px 5px;
            font: bold 12px Verdana, Arial, Helvetica, sans-
serif;
            color: #00f;
            text-decoration: none;
            border: 1px solid #cc3;
}
a:hover {
            color: #f33;
            background: #fff;
            border: 1px solid #000;
}
form {
            display: inline;
}
textarea {
            width: 575px;
            height: 380px;
            margin-left: 5px;
            background: #ffc;
            border: 1px solid #000;
}
#container {
            width: 800px;
            height: 572px;
            padding: 5px;
            margin-left: auto;
            margin-right: auto;
            background: #cc9;
            border: 1px solid #000;
}
#mailsection{
            float: left;
            width: 590px;
            height: 570px;
            margin-left: 5px;
            background: #cc3;
            border: 1px solid #000;
}
#contsection {
            float: left;
            width: 200px;
            height: 570px;
            background: #cc3;
            border: 1px solid #000;
            overflow: auto;
}
.mailfield {
            width: 575px;
            height: 20px;
            margin: 0 0 5px 5px;
            border: 1px solid #000;
            background: #ffc;
            font: bold 11px Verdana, Arial, Helvetica, sans-
serif;
            color: #000;
}
.mailbutton {
            width: 120px;
            height: 25px;
            margin-left: 5px;
            font: bold 11px Verdana, Arial, Helvetica, sans-
serif;
            color: #000;
}
.contfield {
            width: 185px;
            height: 20px;
            margin: 0 0px 5px 5px;
            border: 1px solid #000;
            background: #ffc;
            font: bold 11px Verdana, Arial, Helvetica, sans-
serif;
            color: #000;
}

As shown in the CSS declarations above, I’ve styled the three DIVS mentioned before, together with the buttons and form fields that make up the respective web interface. Also, I’ve specified some additional styles for <h1> headers and links, but as I said earlier, feel free to write the CSS rules that best suit your specific needs.

At this point, I’ve shown you the CSS styles tied to the (X)HTML markup. Now, let’s move forward and define the structure of the web document, in order to finish building the application’s user interface. Scroll down the page and keep on reading.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials