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 / 42
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

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

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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