How to Create a Beautiful and Original Contact Page

without comments

Estimated Reading time: 2 – 4 minutes

Many web-designers often struggle to develop original, beautiful and cool contact pages. This short post proposes a quick and efficient way to pimp such (boring) pages by simply using a few lines of CSS and Google Map.

What you need first is to go to Google Map and to type your address. This done, click on “link” (top-right corner) and then click on “Customize and preview embedded map”. You are now ready to choose the format of your map/the zoom/the position of the label. Of course, you will need to choose a sufficiently large sized map since it will be the background of your form. When you are happy with your map, then copy the iframe code that should look like that:

<iframe width="700" height="550" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
src="http://maps.google.co.uk/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=oxford+internet+institute&amp;sll=44.72293,-107.703874&amp;sspn=143.717289,358.242188&amp;ie=UTF8&amp;hq=oxford+internet+institute&amp;hnear=&amp;cid=9782261097568857188&amp;ll=51.759447,-1.287804&amp;spn=0.058439,0.119991&amp;z=13&amp;iwloc=A&amp;output=embed"></iframe>
<br /><small>
<a href="http://maps.google.co.uk/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=oxford+internet+institute&amp;sll=44.72293,-107.703874&amp;sspn=143.717289,358.242188&amp;ie=UTF8&amp;hq=oxford+internet+institute&amp;hnear=&amp;cid=9782261097568857188&amp;ll=51.759447,-1.287804&amp;spn=0.058439,0.119991&amp;z=13&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a>
</small>

Paste this code into a specific div in your contact page code source, e.g.:

<div id="map">

<iframe blahblah.....>View Larger Map</a></small>
</div>

Now, what we need is to create a second div for the form, e.g.:

<div id="form">
:: Send me an Email<br  /><br  />
<form method="POST" action="">
Your Name:
<input type="text" name="name" size="35><br  /><br  />
Your Email:&amp;amp;nbsp;
<input type="text" name="email" size="35>
[...]
</form>
</div>

We are almost done. We just need to apply some CSS to the two divs we created above, that is, for the map:

#map {
z-index:1;        /*order of display*/
position: absolute;
display: block;
width: 700px;  /*the width of your iframed map*/
height: 550px; /*the height of your iframed map*/
top:70px;        /*the margin form the top*/
}

and for the form:

#form {
z-index:3;
position:absolute;
display: block;
overflow:auto;
left: 390px;  /*position of the div w.r.t. the other one*/
top: 70px;   /*position of the div w.r.t. the other one*/
width: 365px;
height: 530px;
padding:10px;
background: #fff;            /*the background color, here white*/
filter:alpha(opacity=90);  /*the transparency percentage, here, 90%. For different browsers, IE, Firefox, Safari, Chrome*/
    -moz-opacity:0.9;
    -khtml-opacity: 0.9;
    opacity: 0.9;
}

That’s it! Wasn’t it simple? Demo here.

VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Written by Florian

February 21st, 2010 at 6:16 pm

Posted in CSS,Google,How-to,webdesign

Tagged with , , ,

Leave a Reply

2 visitors online now
2 guests, 0 members
Max visitors today: 5 at 12:59 am UTC
This month: 19 at 09-03-2010 06:43 am UTC
This year: 45 at 06-11-2010 02:37 pm UTC
All time: 45 at 06-11-2010 02:37 pm UTC