Skip to main content

How to Style Your Form

Lesson 77 from: Build a Responsive Website Using HTML5 & CSS3

Daniel Walter Scott

How to Style Your Form

Lesson 77 from: Build a Responsive Website Using HTML5 & CSS3

Daniel Walter Scott

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2000+ more >

Lesson Info

77. How to Style Your Form

Lessons

Class Trailer

Getting Started

1

How This Class is Structured

01:41
2

What to Download

02:57

Introduction to HTML & CSS

3

Creating Our First Webpage

05:55
4

What is HTML5 & CSS3

08:24
5

Head vs. Body vs. Html Tag

09:01
6

Title & Description

05:54
7

What Code Editor Should I Use

02:42
8

Using Diy Tags

06:26
9

What is a CSS Class

09:05
10

How to Create Nested Divs

05:03
11

Class Project

05:24
12

External CSS

09:07
13

Creating Our Index Style Pages

12:16

Project 1: Restaurant Website

14

Testing Your Website

08:47
15

Check Your Code For Errors

11:01
16

What are HTML5 Structure Tags

05:47
17

Add HTML5 structure elements

16:02
18

How to Set the Color of the Background

05:10
19

Adding Images to a Website

04:38
20

How to Center an Image

01:14
21

Change the Font Size & Color

14:11
22

Make a Clickable Link

08:45
23

Stretching Background Image

05:38
24

Making a Div Tag Transparent

02:36
25

Simple Website Text Navigation

06:43
26

CSS Compound Classes

07:02
27

Class Project 02

02:05
28

Class Project 02 - COMPLETE

04:48
29

Add an Email Button to a Website

03:49
30

Add Google Maps to Your Website

11:25
31

Making a Website Live

16:50
32

Uploading via SFTP

11:50
33

Setting Up Our New Project

03:46

Project 2: Bike Repair Website

34

CSS Reset

15:22
35

Min-height vs. Height

07:01
36

Div Tags Onto One Line

05:23
37

Getting div tags onto one line using Flexbox in HTML & CSS

05:23
38

Evenly Spaced Div Tags

04:42
39

Two Div Tags of Different Sizes

07:13
40

Vertically Center Content

07:20
41

Class Project 3

02:51
42

Class Project 3 - COMPLETE

05:39
43

Change Default Fonts

04:19
44

Installing Google Fonts

12:44
45

What are PX & EM & REM

14:56
46

Change Line Height

04:33
47

SVG vs. JPG vs. PNG

07:04
48

How to Create a SVG, JPG, or PNG

11:00
49

Block Images vs. Background Images

08:32
50

Finishing Up Our Cards

09:10
51

Icons via Font Awesome

16:31
52

Making a Div Container Clickable

09:55
53

Box-sizing & Border-box

06:19
54

How to Make A Colored Button

07:46
55

Why Can't I Add Margin or Paddding

11:08
56

Rounded Corners

04:17
57

Drop Shadows

06:24
58

Backup Your Website

05:00
59

Reusing a Button Class

03:10
60

Class Project 04

02:58
61

Class Project 04 -COMPLETE

05:45
62

Adding a Horizontal Rule

03:51
63

Make Divs Wrap Onto Separate Lines

12:14
64

Hover Color & Animating a Button

03:33
65

Pseudo Classes

09:31
66

Simple Dropdown Navigation

20:04
67

Adding Our Dropdown to the Website

14:50
68

Useful Shortcuts and Tips in VS Code

13:28
69

Large Background Image

09:24
70

How to Connect 2 Pages

10:42
71

Simple PHP Form Work

17:49
72

Placeholder Form Text

05:46
73

Form Check Marks

03:04
74

Multi Line Form Text Box

02:18
75

Form Radio Button

06:07
76

Form Drop Down Menu

05:48
77

How to Style Your Form

12:55

Project 3: Responsive Portfolio Website

78

What does responsive website design mean

04:17
79

How to change a website layout size color when at different sizes using media queries

11:28
80

How to test your website on a tablet or mobile phone from Visual Studio Code

06:00
81

How to change the layout of a responsive website for mobile vs desktop

16:02
82

How to turn things on and off for mobile tablet & desktop responsive websites

06:03
83

What is pixel density responsive images pixel ratio dp px in webdesign

14:47
84

How to export responsive images for website from XD Photoshop Illustrator

05:11
85

How to add responsive images to website using 100% width in HTML & CSS

06:08
86

How to use srcset to change images in HTML for responsive website

11:18
87

How to add a css style to the first line of a p tag on a website (

11:18
88

How to make the header footer full width but the inside centered

05:36
89

Class Project 05 – Header design

03:12
90

Class Project 05 – Header design COMPLETE

06:25
91

How to use a span tag or span class in HTML to change text

10:32
92

How to pin the navigation to the top of a website fixed nav

03:17
93

How to make a simple responsive mobile menu using CSS only

08:21
94

What is Javascript vs Jquery in website web design

06:35
95

How to make a burger menu 3 line mobile navigation for a website

15:11
96

How to switch a menu nav from desktop to mobile phone

21:45

Project 4: Bootstrap Yogurt Website

97

Overview of what Bootstrap 4 is in website design

07:57
98

How to install Bootstrap 4 on a website using Visual Studio Code

06:27
99

Quick overview of how the Bootstrap Grid Layout works in VS Code

10:49
100

Quick overview of how Bootstrap Components works in VS Code

09:23
101

Quick overview of how Bootstrap CSS Styles works in VS Code

08:20
102

How to customize the default Bootstrap 4 css styles

13:51
103

How to use Bootstrap Layout Grid Experiment 1

10:20
104

How to make 100% header & uneven widths in Bootstrap 4

07:16
105

How to create uneven col widths in Bootstrap 4

07:27
106

How to add padding & margins using Bootstrap 4 in VS Code

12:03
107

How to change layout of Bootstrap depending on mobile or desktop

15:46
108

How to turn things on & off on your website using Bootstrap 4

05:30
109

Google Chrome Inspect

12:40
110

Add Shadows to Text & Boxes

07:06
111

Change the Default Buttons

06:16
112

Responsive Images in Bootstrap 4

09:34
113

How to Center Text & Div Tags

04:16
114

Customize the Bootstrap Navbar

07:29
115

Add Your Own Logo

03:58
116

Change the Default Nav Styles

12:12
117

Fix the Navigation to the Top

04:41
118

Col Images & Col Background

07:56
119

Bootstrap Border & Rounded Corners

04:20
120

Bootstrap 4 Carousels

05:13
121

Card Groups

03:29
122

Drop Shadows On Bootstrap Cards

02:25
123

Clickable Boxes in Bootstrap 4

04:02

Final Quiz

124

Final Quiz

Lesson Info

How to Style Your Form

Hi there. Fun fact. Web design makes you better looking totally does. It's not really working for me personally, but it's definitely working for this form, ugly form. Good looking form. Okay, so exact same form. Just going to change the CSS There's some fun targeting that we need to do to attach ourselves to these guys and style them. We'll put some spacing between things, labels with gaps in them. We'll make our button look a little prettier. We'll update the sample text in here. Alright, let's get better looking. All right, we'll start with the text boxes here, the input text. So what is it called? So is my beginning of my form. So we're gonna start all the things inside of this down to. It's getting quite big. Here's the form. Okay. And this is my first one, not the label. We're gonna talk about the input text. Okay. And to do this in our CSS. Okay. We need to add some special syntax so it's input. Okay? But then you've got to put it in square brackets, not curly brackets, square br...

ackets. Okay. And you decide on what kind of type it is and in our case it's text. The type of text. Okay? You can kind of see it here. Basically we're just typing this at the input of these to the type equals text. So it's just a kind of different format here in CSS. Then we add our curly braces and that's how we style it. First of all, I'm going to add some padding around the outside just to make the text box a bit bigger. Okay. I want it to be kind of like 12 on the top and the bottom and I'll have 20 on. Okay, Yeah, top on the bottom, left and right. Save it. Let's have a little look and there you go. There's that one and you're like, I gotta do to this one as well because this one has a slightly different name. This has input of type email. So what we might do is just copy that and put a comma in. So I'll do both of these. Just gotta make sure this one is email. Cool muscle dude, text area while we're here. So same thing now, it's not quite the same thing. Okay, It's structured differently. Remember these input types were different from this weird thing we did. Text area was just kind of like its own tag. So the same that goes over here. So we just do text. Here we are. There it is there, that's all we need to do. So I want to start the text area to have a little look, it's all looking good. Got my padding, it's gonna look nicer. You can give these boxes widths. Okay, so all of these guys could have a width of, you could use percentages or pixels, let's say 40% Here, we go through all 40% of the available space. Now let's move the text that's inside of it. It's quite small and it's the wrong kind of font so we can do that as well. So we've targeted them, we're going to say font family and we'll use the one we've already used. We're using we're using Roboto. Doesn't pre fill it in. Gonna go steal it. Roboto, but he is Roberto. Thank you very much. Let's check it out. Okay, now it's Roboto just needs to be a bit bigger so far in size. I had it there, font size. Let's just look at one rim, see how it looks the same as the rest of them. Actually, I might make this the forms, do I make it a bit smaller? I feel like if I do, it feels good as a designer having just like a little bit of kind of hierarchy for, you know, big text, that's the most important and this is the next thing. And then these guys kind of step down another font size performs any tourists notoriously problematic for people that are visually impaired. Okay, So making it smaller and it's quite a light gray with skirting some accessibility issues. Alright, so we've got that that that's one of the things that might be driving you mad is this is on the same line as this. Okay, that's up to you. There's a couple of ways to fix it. We could we were using this wrapper. Okay, so I could say actually the label could be in its own wrapper, we'll do it together. Okay, just to show you the different ways because there's different times we need both of them. So there's label. Okay, can you just come out of that wrapper there he is there. Okay. And to have his own Okay, you go up here. I'm going to wrap them in my, what we call it? It's called input, input rapper. I can't put it there. We've got to wrap with abbreviation first, then put it in. Okay, so now he's on his own line. That line that's on the 2nd 1. Okay. We're starting to get messy in terms of the HTML. So that's our way. What we might do is a slightly I'll just show you a different way. Okay. What we could do, but it's probably not going to work is we could attack these labels. We could say label. I would like you to be on its own line. Do you do you remember This is like a pop quiz. Okay, pause it after I asked the question and see if you can work it out. I wanted to be on its own line at the moment. It's in line with this guy. Okay. How would I get him to go on his own line? Give it a go. All right. If you'll I have no idea. Remember that our display. Okay, by default. It's in line so we can say display block. Okay, so all labels that display block and that's going to work. But then you get down here and you're like actually I wanted these guys next to it. So not quite what I wanted. So what I might do is I might say I'll leave that there. But instead of using the label, I'm going to create my own one. We're going to say new line. No line. New line. Okay. So I'm going to use this and just apply it as a class to the labels specifically. So this particular one. Okay. Just at the just before the little tag ins I'm gonna say class of new line. Let's have a little look. So this guy has got his own line and what I might say is his new line with margin at the bottom of 20 pixels too much. Let's say 10 pixels. Yeah, that works for me. Make sure you close it off. The other thing I might do is just looks better I think with more spacing between them. Okay. And I probably need some space after this p tag. We'll look at that in a second. But let's do this one. So yeah, I get to reuse this one and because I've kept it reasonably generic. Okay, I could use new line throughout my whole website. Doesn't have to be for this particular form. So I could say you I want it on email as well. Okay. So before this little label closes, you're going to have a class of a new life. Cool. Alright. What next consent to the Moore Lab? There's a few other starting I want to do 40%. Is it big enough? You can make it 100%. Okay, so where is it for us? Code we sent us to our with all these fields to have a width of. There you go. Now they go across um It's kind of 100% plus the padding. Remember we've added 20 either side or 30. Okay, so we've added that plus the 100%. So it ends up going too far. Another pop quiz. How do we get it? We could start minus sing it. Okay, we could minus, we could take off, we can make it 97% and fake it. Remember there was a property that magically did it for us. It kind of takes the overall size and minuses off margins and padding had a weird name. I'll introduce it again. Do you remember pause it? Think give it a test even. It's really hard to remember. I always forget it is called, what is it called? Box sizing. Box sizing, go border box and hopefully it'll do the work for us. There you go, sliced off the padding fits in nicely. Need to add a label to this one here, which I haven't done yet. It's okay. One of the things I want to do all of this looks okay. We'll do some fun stuff in a second. But the spacing between these two. I'm happy that they're on their own line. So let's get them pushed apart a little bit so we could cheat. My instant lazy brain says cheat and in this course we're like, we shouldn't show you how to cheat, but I'm gonna show you the cheap because you'll come across it. Some other lazy person will do it and you will touch them. You'll say, I can't believe they did that. And you put an ampersand and you put it in a non breaking space semicolon. Okay. That is there because we know if we put in spaces, right, I'll delete this. Okay. If I put it in a space like this, it gets ignored by the code. He doesn't care if you got space as it returns, it's still the same. But you can, let's undo that undo it even. Okay, I could go not breaking space. I can paste a few of these in. Okay. And it will push across. The only problem with that is you're doing in the html and the styles that it's kind of, it is nasty gay but works put it in there because hey, my brain went, let's just put that in and then I thought I'll show it to you because you're going to run into are websites that people have done it lazy people like me to kind of do it for spacing. So we should do it in code. Okay, so in this case we're going to create a new class. I have a few helper classes that I use. Okay, so this one's just gonna be, I'm gonna call this one very generic. This is going to be called margin. What is this one? I want margin on the right to left. I'm not even sure I want margin. I'm going to apply it to the label, margin on the right to push over across. So it's going to be called margin. Right? I'm gonna call this one a because I'll do a few of them. Okay. And this one here is going to be as you can imagine. Imagine rights Okay. of I'm going to put in 20 pixels just check out what this one is. Okay, so I'm going to use it because I don't trust my spelling on my typing at least copy that. And I'm going to go over here and apply it to this label just before it closes. I'm going to say you have a class of this one when you are copying and pasting, be sure not to grab the full stop because the full stop doesn't it's not needed over here. If you leave it in, let's have a little look. Didn't appear. It's not working Okay. Sometimes it can appear in the html. Anyway, so there's my little class there. I've added it to it and if you want to target, say all radio buttons. You got lots of radio buttons. Okay. And you want to say push the spacing away from here. Okay you've got to kind of remember the weird input, remember input and then it's square brackets then you work out the type you're trying to target. Okay. And we're done to do the radio ones at the moment. There's a radio, Yeah, type radio. That's how you target those fellas. And then I'm going to say all right, I want a little bit of margin to the right as well mara, right, and you can see how you can get really lazy with the helpers. Okay? You just type in ma to kind of get it close and then I just started typing are and then that's all I needed. Okay, you got me close enough to it. All right. And I want just maybe 10 pixels to the right of them just to kind of open them up a little bit because we're just doing a really simple form. You might have a big giant form. Last thing we'll do is style this fire away button. I'll submit button. Okay, so in here actually I've accidentally renamed my this should be male, not mail too. I don't have a male too. Alright, so submit button you can start styling the input and type submit over here. Okay, that would work. Um We're gonna not be lazy, we're gonna be resourceful. We're going to add a class of col my button. It's a little while ago now, I can't remember. There you go now. You'll notice that it's not quite exactly like the button we had on our homepage. Okay. It's very similar. So we've kind of got close but there are some styles that we're gonna have to turn off in particular for this button for me it's close enough. Okay. But so you might make another style and start applying it. But the submit button has this kind of weird outline, you're gonna have to turn off and around the corner, you're going to have to turn off so either might create another class, start with my button and then add some border border styles of none rounded corners of zero or I'm just gonna leave mine All right, I do need some space underneath it. So what I might do the form in general. I need some stuff at the top and at the bottom. So I might just start to form might say form please. Can you have some margin? So margin. We'll use our we'll use max resolution will type margin And we'll use our shorthand. So top and bottom are going to be, I don't know, 40 pixels And the left and right are going to be zero. See how that goes. There's a bit of the top bit at the bottom. I'm happy enough with it. Are you happy? I'm happy we got a form missing a label. It's okay. We've styled it got a sweet dropdown menu, you can style that as well. Okay. Again just input. Actually it's different, it's called select not an input. Alright. So that's gonna be, it performs. There are kind of just scratched the surface in terms of forms and we did a little hack for some PHP to send us an email, but there are lots more as a bit of a rabbit warren of forms. But yeah, good overview. I hope we'll leave the forms there for now and I will see you in the next video.

Class Materials

Bonus Materials with Purchase

Exercise Files
Completed Files

RELATED ARTICLES

Recent

Articles

Recent

Articles

Recent

Articles

Recent

Articles

Recent

Articles

RELATED ARTICLES

Recent

Articles