8. HTML – Adding Styles and Formatting HTML Elements

8. HTML – Adding Styles and Formatting HTML Elements


Hello everyone and welcome back. In today’s video we learn how to add custom statements to CNN. Let’s say for example we have this extreme age but doesn’t looks very good but we can make it look good by adding some colors. Rock was facing the elements on background. Now the question arises how do we do all this whether we can use CSI is cascading style sheets CSI strikes us with options to are all of these styles and much more to add uses styles as G.M. provides us with an attribute called a style let’s try an example to understand it better let’s make this stop so first let’s make our image on the screen so let’s use that style. So in styling we have this and other property with so which defines the width of your element. So in our case that’s a hundred percent. So one hundred percent does is it gives the width of fighting data screen or name space the. All right let’s say the as you can see it’s different than today with no but the height is a bit more than our speed size. So let’s reduce the height not only of image of a trim but that’s okay. So do I. Another goal would be to separated by a single and then that’s another property. So height. Let’s give it a high. Say six hundred pixels and see that. So now the images in the screen also pixel is the unit used for dimensions here. So even the font size the border radius or the way the height everything. Whenever we’re working with Dimensions we’ll be using the unique pixels. All right. Now there is is this extra space between the edge of the screen and the image. So this is because it’s demoed by default at eight pixel margin anybody. So that’s we want to point it out. Let’s. At this time here. So let’s change the margin do you. Let’s say that. And now as you can see the margin is gone. The margin is the space outside of element. So if you instate here you see that red strip. That’s our margin. The blue is the box in which we have our economy. And outside that box. There is this big space which is margin right. Civil war heroes. This former so talking about the heading. So if we just had a let’s other style of tribute let’s use the margin go. So when we see margin the modernist above the box below the box left of the box in light of the box. All right. So to remove the margin from all the sides or to affect the margin on all the sides you can just slight margin. So if you see margin 16 pixels it would mean you give a margin on top 16 pixels on right 16 pixels on what unsexy pixels on the left. But if you want to change a specific margin you have to. So in our case we want to change the clock margin. So it seems that the margin Doc see 60 pixels and say that I mean black space on the top. Similarly less of a margin and more say margin bottom 16 pixels. Let’s say the let’s inspect it again. So I click. And now when you are so on top and bottom there is a rating strip and if you see here there’s a margin dog in Baltimore sixteen vixens All right. Now let’s bring the healing in the center of the screen. So for dogs yes this delights us with another property. It’s a line the name I suggest to align the decks so we can give it a value off center. Let’s say even now as you can see our heading is in the center of the screen don’t worry you don’t have to memorize all these properties right now. Just remember you can do something like this using synapses with lots of practice. You will remember these properties by names. So for now just don’t worry. All right. So let’s increase the font sizes a little bit. So as the property name suggests we are talking about the size of a five it’s or fun. Say for example you want to give it 48 pixels. Let’s say you’re now as you can see a font is a bigger not moving on these other sections. All right. So for this first paragraph let’s add some bottom and all the science so style let’s say that in 16 pixels. So because of this I’m just following suit the way I read it for a margin just saying what it means not a body on all the sites Top Right Bottom in left let’s say that unofficially spent here so there’s a margin the Vegas strip is the margin the green one is the body in blue is the fountain. So when you got the whole body. So it’s the space outside of the container. And when you talk about margin it’s about the space even outside the body. All right so coming back let’s increase the font size. It’s barely legible. So font size let’s say 24 pixels. Let’s say that. Now as you can see the font size is much bigger. Let’s increase the space between the lines. So for that we can add another property line height say one point five. A lot. And there’s more space between the lines. Similarly now if you want to do styling to the second paragraph you have to copy paste the same styling so if you want different things you can do without. But in our case I’m just going to copy paste so let’s just copy it on a stick to it. Let’s see. I want it to look identical. And on as you can see both of our addresses look much cleaner on similar what one to the last one so for this heading. Let’s give it a status. Let’s give it a second size say 24 pixels. Let’s give at the bottom of left say 16 pixels. So now it’s in line with other paragraphs. Similarly for our list let’s add some styles. So again the styling attribute. Let’s give it a fun size bigger so font size C twenty four pixels. Let’s save it. And now as you can see a font size is a bit bigger now if you see our website looks much much better much greener. It just looks better now for example if you want to order background color to your entire page you can decide it to the point that so here next to the margin. Let’s give it a background a little say hash f do f six F F let’s say now as you can see it has got this very light bluish bottom also full of colors. There are different ways to light pollution and just give it a name see light blue or you can use the hex codes. So the way we use right now so F2 x six F F are and other ways you can use our G boots. So our GDC 0 0 0. So this would be black. And now as you can see the background is black but everyone so they’re just name it. But do I origin of the color which was f do six F F silver it has a light blue background. Similarly I want to change the color of fine. Say for example we want to change the font good for a heading so we would yes just use the C as a scholar color and say if you want to leave. So let’s just say that we save it. And as you can see the color of our font as a again. Don’t worry about remembering all these qualities. It’s gonna come dine with practice. Also you’ve seen so many new paintings and sea horses. Don’t worry I’m. I’m creating another see if the scores make an extra tens of CSA schools into any starting from basics to advanced concepts so that you can learn more about sciences. But for now this is the basics. And we’ll be brushing up on this in the coming because we’ve been using some property and another video we’ll use another property. So don’t worry we just keep brushing up on these properties and eventually you’ll love it don’t worry. All right. That’s all for today guys. If there’s something that you did not understand through and through of local government and we will discuss it see you in the next video by Andy.