How to add a css style to the first line of a p tag on a website (
Daniel Walter Scott
Lesson Info
87. How to add a css style to the first line of a p tag on a website (
Lessons
How This Class is Structured
01:41 2What to Download
02:57 3Creating Our First Webpage
05:55 4What is HTML5 & CSS3
08:24 5Head vs. Body vs. Html Tag
09:01 6Title & Description
05:54What Code Editor Should I Use
02:42 8Using Diy Tags
06:26 9What is a CSS Class
09:05 10How to Create Nested Divs
05:03 11Class Project
05:24 12External CSS
09:07 13Creating Our Index Style Pages
12:16 14Testing Your Website
08:47 15Check Your Code For Errors
11:01 16What are HTML5 Structure Tags
05:47 17Add HTML5 structure elements
16:02 18How to Set the Color of the Background
05:10 19Adding Images to a Website
04:38 20How to Center an Image
01:14 21Change the Font Size & Color
14:11 22Make a Clickable Link
08:45 23Stretching Background Image
05:38 24Making a Div Tag Transparent
02:36 25Simple Website Text Navigation
06:43 26CSS Compound Classes
07:02 27Class Project 02
02:05 28Class Project 02 - COMPLETE
04:48 29Add an Email Button to a Website
03:49 30Add Google Maps to Your Website
11:25 31Making a Website Live
16:50 32Uploading via SFTP
11:50 33Setting Up Our New Project
03:46 34CSS Reset
15:22 35Min-height vs. Height
07:01 36Div Tags Onto One Line
05:23 37Getting div tags onto one line using Flexbox in HTML & CSS
05:23 38Evenly Spaced Div Tags
04:42 39Two Div Tags of Different Sizes
07:13 40Vertically Center Content
07:20 41Class Project 3
02:51 42Class Project 3 - COMPLETE
05:39 43Change Default Fonts
04:19 44Installing Google Fonts
12:44 45What are PX & EM & REM
14:56 46Change Line Height
04:33 47SVG vs. JPG vs. PNG
07:04 48How to Create a SVG, JPG, or PNG
11:00 49Block Images vs. Background Images
08:32 50Finishing Up Our Cards
09:10 51Icons via Font Awesome
16:31 52Making a Div Container Clickable
09:55 53Box-sizing & Border-box
06:19 54How to Make A Colored Button
07:46 55Why Can't I Add Margin or Paddding
11:08 56Rounded Corners
04:17 57Drop Shadows
06:24 58Backup Your Website
05:00 59Reusing a Button Class
03:10 60Class Project 04
02:58 61Class Project 04 -COMPLETE
05:45 62Adding a Horizontal Rule
03:51 63Make Divs Wrap Onto Separate Lines
12:14 64Hover Color & Animating a Button
03:33 65Pseudo Classes
09:31 66Simple Dropdown Navigation
20:04 67Adding Our Dropdown to the Website
14:50 68Useful Shortcuts and Tips in VS Code
13:28 69Large Background Image
09:24 70How to Connect 2 Pages
10:42 71Simple PHP Form Work
17:49 72Placeholder Form Text
05:46 73Multi Line Form Text Box
02:18 74Form Check Marks
03:04 75Form Radio Button
06:07 76Form Drop Down Menu
05:48 77How to Style Your Form
12:55 78What does responsive website design mean
04:17 79How to change a website layout size color when at different sizes using media queries
11:28 80How to test your website on a tablet or mobile phone from Visual Studio Code
06:00 81How to change the layout of a responsive website for mobile vs desktop
16:02 82How to turn things on and off for mobile tablet & desktop responsive websites
06:03 83What is pixel density responsive images pixel ratio dp px in webdesign
14:47 84How to export responsive images for website from XD Photoshop Illustrator
05:11 85How to add responsive images to website using 100% width in HTML & CSS
06:08 86How to use srcset to change images in HTML for responsive website
10:15 87How to add a css style to the first line of a p tag on a website (
11:18 88How to make the header footer full width but the inside centered
05:36 89Class Project 05 – Header design
03:12 90Class Project 05 – Header design COMPLETE
06:25 91How to use a span tag or span class in HTML to change text
10:32 92How to pin the navigation to the top of a website fixed nav
03:17 93How to make a simple responsive mobile menu using CSS only
08:21 94What is Javascript vs Jquery in website web design
06:35 95How to make a burger menu 3 line mobile navigation for a website
15:11 96How to switch a menu nav from desktop to mobile phone
21:45 97Overview of what Bootstrap 4 is in website design
07:57 98How to install Bootstrap 4 on a website using Visual Studio Code
06:27 99Quick overview of how the Bootstrap Grid Layout works in VS Code
10:49 100Quick overview of how Bootstrap Components works in VS Code
09:23 101Quick overview of how Bootstrap CSS Styles works in VS Code
08:20 102How to customize the default Bootstrap 4 css styles
13:51 103How to use Bootstrap Layout Grid Experiment 1
10:20 104How to make 100% header & uneven widths in Bootstrap 4
07:16 105How to create uneven col widths in Bootstrap 4
07:27 106How to add padding & margins using Bootstrap 4 in VS Code
12:03 107How to change layout of Bootstrap depending on mobile or desktop
15:46 108How to turn things on & off on your website using Bootstrap 4
05:30 109Google Chrome Inspect
12:40 110Add Shadows to Text & Boxes
07:06 111Change the Default Buttons
06:16 112Responsive Images in Bootstrap 4
09:34 113How to Center Text & Div Tags
04:16 114Customize the Bootstrap Navbar
07:29 115Add Your Own Logo
03:58 116Change the Default Nav Styles
12:12 117Fix the Navigation to the Top
04:41 118Col Images & Col Background
07:56 119Bootstrap Border & Rounded Corners
04:20 120Bootstrap 4 Carousels
05:13 121Card Groups
03:29 122Drop Shadows On Bootstrap Cards
02:25 123Clickable Boxes in Bootstrap 4
04:02 124Final Quiz
Lesson Info
How to add a css style to the first line of a p tag on a website (
Hey there, this video, we're going to look at adding a CSS class to make things bold for the first line only, it doesn't matter what's in the line. Okay, Everything will become bold. You can do it for the first letter or the first line. It's a funny little bit of CSS. Let's work out how to do it now, in V. S. Code. Alright, so looking at my mock up, that's what I wanna do. Okay, I want to make the first line bold and then the second or all the rest of the lines, Not bold. Cool. So we are going to look at our weird little CSS class. So Visual studio code, the first thing we need to do is add a bit of text. Okay, so we're going to add it to all of the l a little boxes at the moment. We've got nothing so to clean everything up, let's get rid of the background color. Okay, I'm going to use it for in here, not in the background. So I'm gonna go to V. S. Code. My container has a color that I want to steal and add back to the columns. Okay? Because before I wanted to get rid of it now I want ...
to edit that's kind of picking out the bottom there, but it's all right, I'm going to add text and make it really big. You could um what we're gonna do actually, let's just do it then. And so the column here is going to have some text inside of it the moment it has an image after the image. Okay? So because my image tag kind of finishes there, I'm going to put it in a P tag. Okay. And I'll put in some Lauren Ipsum one about 8 words. Okay. And I want at the beginning here, um, putting the word branding. Cool. So that's what I want to start. I want to target this. Okay, and let's have a look at it in here. You can see how, what I've done here. I've made the column. Okay. It has a it doesn't have a height so it expands for the stuff to fit it in. There's an image in it because they can't fit together, they squish out and the column gets a little bit bigger. I could make a second div underneath it. Okay. Call and then I don't know cole name and style that green in the background, but This one is a bit simpler. Okay, I want to go and style it or looking really good. But let's just put in the bowl first because that's what you came for. And the way to attack it is we're gonna put it in our global styles. It's not crazy difference in tax except we use two colons. Okay. To join them up. Okay. And I want to style the first first line, you can do the first letter, the line. I really want the first word, but that's not an option. So I'm going to do first line. Okay. And I'm gonna make the front weight. Okay, font. Wait, I'm going to make it bold Only because I don't have I should put in like 700 is a very normal bold size but I haven't picked a font yet which is using times roman. You can put any style you like as long as it's text styling and it's going to kind of work and have a look works perfect. Okay. The reason I say kinder is that I'm kind of attacking all p tags first lines and in our mock up here we're going to have more than one bit of text. Okay, so there's gonna be text here here here. I'm bound to have another page with like I only actually have one P tag on this website. But if I go to the contact us page and I build that out, I'm going to use lots of p tags. I don't want them all to be bold. So we're going to be very specific. Okay, so we're going to say only the first line of p tags that are inside columns. Okay, so the space between those two to Collins to join those two up. That's how to do that one. Let's go through install a font. We will get it looking like this. Where are we going to cover anything new? No, we're just going to put some padding in, make it wide to make it the right font. You can skip along if that all sounds easy to you but if it doesn't carry on, we'll do it together. First up a font. So I'm going to go to google fonts at google dot com slash fonts. The fund that I've decided type it improperly is something called a sp just a really good free all rounder comes in condensed as well, which is really cool. I'm just going to use the regular plus. We've done this before, but it's good to kind of recover these things. Little minus you can download them now to start using them on your computer, but to use them on your website, you use the embed. I want to customize it because I've decided to use regular and bold and none of the other ones. Okay, so I'm gonna embed it. I'm gonna grab you copy that goes into a head tag. So as long as it's before the closing of the head, there you go. You notice on this website, I'm only so I guess it's kind of simple website, but I've decided instead of using like a display font or a Syrah font, I'm just using the bold and the light version to get away with kind of like trying to organize the hierarchy of information. So I got the font. Let's apply it. So what I'm gonna do is I'm going to play to everything, you remember how to do that. Everything in this document, I want to be a SAP, that's right, you do it to the body. Okay, so the body tag here is going to be a font family. Okay. And I'm going to grab this from family. Save it. Let's have a little look and our preview. There you go. It's the right the right font at least let's pick a size and color and some padding. I'm going to check my mock up. You are a font size of now, I'm going to create my own one. Okay. Because I don't want to do all p tags this. I want the p tags that are inside the columns to do this thing actually could probably do it to the column, everything inside of them. But we'll do it this way. Let's go color. It's going to be white. Let's do our font size. Mhm. Okay. Remember calculator, It is going to be 14 times .06-5. Random. Okay. And where is he? That's gonna be it. And it's going to be Reames, we're gonna do some padding and we'll do our fancy all the way around. So top is going to be no idea. Okay, and side to side is going to be no idea. Good guesses. Let's have a look. Yeah, it's all right. It's not looking as kind of defined as that. So let's add a bit more I guess I'll show you this because I I I could go through and before the class and I guess write this out on a note for myself to make it seem smoother. But this is the kind of stuff that I end up doing, I'm like no back here, no back here. Testing trialing. Okay, so maybe 25 for the height. Oh that'll do for me. Okay. You'll notice that our ball went away. You might have noticed already. I just noticed there. Okay. Is why? Because we're trying to apply ah I can't wait, that doesn't exist. This one uses 700, not the word bold. Some points used bold. Okay, assumed that was it. Just make sure refresh right click. Why are you not loading now? Soapy first line coal. That is all still true. That is all still true. Alright confession time I was gone for a big five minutes. They're trying to work out what happened. You might already noticed it. Okay it's a syntax problem. Okay the problem is this guy was missing his little I am a class full stop in front of him, jesus took me a little while though and I guess I want to leave this in because it happens to everybody and I'll kind of go I'll kind of give you the skinny version of what I tried to do to fix it and how I eventually did it. So because basically work backwards and you go or what was the last thing I did and I was like that was the last thing I did so let's just turn that off, so remember command forward slash on mac, control four slash mp and adds it to commenting. It means it turns it off, so it's not read by the browser anymore, so it's as good as the leading it except it's still there and you go through and I'm like, great, well actually we'll add that fixed problem, so that was the problem, right, we'll ignore that. So I turned it off and it was still not doing, it was like, okay, so with it on, it doesn't work with it off, doesn't work, so it's not you. So I was like, all right, maybe I need to go and I keep turning things off, okay? And then I'm like up here, maybe I need to set the font weight up here to be 401st, okay, 400 then later on, turn it to that didn't work either. Okay, so I was just kind of messing about and eventually I get to the point where I'm like, no idea, nothing visually. So I just started typing it out. Okay, so turn that on and off. Didn't work. And then I'm like, okay let's re type it. So I just went through and I started typing and instantly you can start to see, you know, okay, it's one character out already, and I was like, God, jeez, that was it. Okay, don't lose your full stops or your periods. Alright, Are we back? We are back, I'm gonna turn this back on, you can see how it's nice to just turn this stuff on and off your back, your back. We're looking good. Another thing we'll do is it's jammed together because we're using a CSS reset. So this column P is going to have a line height as well. As long as it's above one line height, it's a good place to get started. 1.5 rem two big, 1.25, awesome. Actually, in this case, as long as it's above that, not one, it's as well as long as it's above whatever the font sizes being said. Okay, so as long as it's above .8, it will get bigger, anything less than that and it will get smaller, negative line height. Not something that I've done. All right now, I'm going to go through and just keep adding to these boxes. Okay? So you can skip along, I'm just going to copy and paste but you can hang around if you like. You never know what will dig up in terms of shortcuts or getting lost and fixing it. I'm going to get a view. I'm actually might close this down now. Get a full view, make it a little easier. I'm gonna use this p tag repetitive lee, I'm going to copy it. I'm going to use my multi cursor to go. You holding down my queue holding down my option key on a Mac old key on a pc, grabbing all of these guys, that guy there and pasting them in. Hopefully it should all still work if I patient in the right place. Nice. The benefit of the first line class rather than wrapping this first P tag and maybe having to pee tags in here and just putting a star on the first one. Is that if the text gets longer or changes so one's branding, let's actually make this If you put them more than one Lauren Ipsum. Okay, so Lauren, we're doing a test together. If I put in eight words again, do you get different Lauren ipsum? No, exactly the same every time. So ah Alright my high school typing class um breast. It's okay and it's hard, I can't see my fingers. Alright, but we've got this third one and there we go because it is doing the first line, it doesn't matter what you type in there, it's going to be bold, which is handy, be sweet if you could do kind of a grip style style where you can kind of get the first word. Hey hope that's all we wanted to do a little production video though. We kind of started off learning some cool CSS and then we went on a little bit of a journey but we're here, we made it, get onto the next video
Class Materials
Ratings and Reviews
Viwosoft Technologies
Great tutorial - your clear instructions and concise explanations make learning HTML5 & CSS3 a breeze!
Student Work
Related Classes
Branding