You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forms are used to capture information from a user. The information processing and form submission usually requires the use of a server-side language such as PHP, Ruby or Python. But there are different services available to help do the processing for us without writing any of these languages.
29
+
30
+
Let's first look at what each of these form controls do.
31
+
32
+
* `input` tag are used to allow the user to type in their information and is used with a `type` attribute to determine the kind of information it is.
33
+
* The `label` tags are used to label the input or else the user would not know what information to enter.
34
+
* The `name` attribute is used to label the fields when sending the form data to the server.
35
+
* The `for` and `id` attributes associate the label to the input and should have matching values.
36
+
37
+
A form can contain any HTML markup (paragraphs, lists, etc.) in addition to form specific HTML tags. [Each part of a form is considered a paragraph](http://dev.w3.org/html5/spec-LC/forms.html#forms) and can be separated using `<p>` elements.
There are many services that help with form submission. Let's look at [FORMS by Brace](http://forms.brace.io/).Through this service, the information will be forwarded to your email. Simple!
46
+
47
+
Remember, all forms begin with the `form` element and requires two attributes, `method` (defines how the form will communicate with the web server) and `action` (provides the file path to where the form script is processed after the form is submitted.
48
+
49
+
Since we're using a 3rd party service, the `action` value is *their* url *and* the email you want the form to be submitted to.
Brace.io requires that you verify your email first. The verification email will be sent on the first form submit so make sure you test your form first!
61
+
62
+
Also note, this service only works on a *server* so you can't test it *locally*, meaning, just from your computer. You'll need to upload it to a server or run a local server to test it.
63
+
64
+
See [getting your site online](../index.html#slide89) or [how to run a local server](http://mac.appstorm.net/reviews/internet-reviews/running-a-local-server-with-mamp/).
65
+
See further documentation here: [http://forms.brace.io/](http://forms.brace.io/)
66
+
67
+
Another services to check is [Wufoo](http://www.wufoo.com/).
68
+
69
+
You can even use Google Docs to create a form that will add the form submissions into a spreadsheet. View these sources here:
* [Contact page](framework/extras-form-styles.html) - adding background images & form styling
1813
-
* [Forms, pt 2]() - how to submit a form
1813
+
* [Forms, pt 2](framework/extras-form-submission.html) - how to submit a form
1814
1814
* [Home page: additional styles]() - this includes using icon fonts.
1815
-
* [Add a favicon]()
1815
+
* [Add a favicon](http://blog.teamtreehouse.com/how-to-make-a-favicon)
1816
+
* Use the [Font Awesome icons](http://fortawesome.github.io/Font-Awesome/) to add your social icons to the footer. See **final** folder files for examples.
1816
1817
</div>
1817
-
1818
-
<sectionclass="slide" data-markdown>
1819
-
##Getting ready Final Exercise #12
1820
-
1821
-
Before creating the home page drop down menu, we'll need to talk about icon fonts and pseudo class first.
1822
-
1823
-
###Icon fonts
1824
-
Icon fonts are an easy way to add imagery to your web page but still have the flexibility of styling properties like size and colour using CSS since they *are* fonts!
1825
-
1826
-
There's many to choose from but today we'll use Font Awesome:
Under **Getting Started**, there are different options for adding the font files. If using the CDN, remember to add the "http" to make it work when you run your page "locally" (on your computer).
1830
-
1831
-
Simple to use, pick an icon you'd like to use and copy the supplied markup and class and that's it!
1832
-
1833
-
###Pseudo Class
1834
-
A CSS pseudo-class is a selector that specifies a specific *state* of the selected element. Today we will be using `:hover` to apply a style only when the user hovers over the element specified by the selector.
1835
-
1836
-
More about pseudo classes: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
1837
-
</section>
1838
-
<sectionclass="slide" data-markdown>
1839
-
##Exercise #12 - Home Page Drop down menu
1840
-
1841
-
1. Add [Font Awesome's CSS file](http://fortawesome.github.io/Font-Awesome/get-started/) to the `head` of your document and the markup for the [three-bar icon](http://fortawesome.github.io/Font-Awesome/icon/bars/) to the navigation.
The next step is to override the horizontal navigation styles that are shared among the other pages and make it specific to the home page. There is already a class of `home` in the body so we can use that to make our selector more specific.
1862
-
1863
-
1. Set the list items to display block so they line up on top of each other.
1864
-
1865
-
```
1866
-
.home nav li {
1867
-
display: block;
1868
-
}
1869
-
```
1870
-
1871
-
1. Right align the icon and the list items. This can be added to the `nav` selector so icon and list items will inherit the styles. Change the font size to make it bigger too. The icon will also need a little bit of padding to make the hover target a little bigger and for alignment.
1872
-
```
1873
-
.home nav {
1874
-
text-align: right;
1875
-
font-size: 25px;
1876
-
}
1877
-
.fa-bars {
1878
-
padding: 15px;
1879
-
}
1880
-
```
1881
-
1882
-
1. Now we need to hide the navigation list and show it when you hover over the icon. Hide the list first.
1883
-
```
1884
-
.home nav ul {
1885
-
display: none;
1886
-
}
1887
-
```
1888
-
1889
-
1. With CSS, you can apply a hover on a parent element and use the descendant selector to change the style of it's children!
1890
-
1891
-
```
1892
-
.home nav:hover ul {
1893
-
display: block;
1894
-
}
1895
-
.home a:hover {
1896
-
color: black;
1897
-
}
1898
-
```
1899
-
1900
-
Your home page should now look similar to [example 12](project/examples/exercise12-home.html).
1901
-
</section>
1902
-
1903
-
<sectionclass="slide" data-markdown>
1904
-
##Next steps & "Homework"
1905
-
1906
-
Though we've covered a lot of material today, there are still lots of things to add to give your web page that extra personalization and polish.
1907
-
1908
-
Take a look at the files in the **final** folder for some ideas. Use the Font Awesome icons to add your social icons to the footer or try adding a [favicon](http://blog.teamtreehouse.com/how-to-make-a-favicon).
1909
-
1910
-
There are also plenty of online resources available such as:
1819
+
##Online resources
1911
1820
1912
1821
* [A Beginners Guide to HTML & CSS](http://learn.shayhowe.com/html-css/)
0 commit comments