排行榜 统计
  • 建站日期:2020-12-31
  • 文章总数:831 篇
  • 评论总数:8 条
  • 分类总数:7 个
  • 最后更新:3月1日
推荐菜鸟课堂

8. Comments, White Space and line breaks

本文阅读 0 分钟

All right welcome back my dear student on this lecture here we are going to be exploring how to make

comments about space about why space and about breaking the rules actually not is actually called line

breaks.

But anyways there's no breaking rules here.

I just I just wanted to make a little joke there.

But anyways so we're going to be using this blank that a female to make something else so let's go ahead

and do a save as on this file and we're going to use this here real quick and we're going to do save

as.

And we're going to call this what we're going to call this universal because we're going to be doing

comments right comments.

You need versal the H.M..

All right.

That's a strange name for a document isn't it.

All right.

We're going to be very descriptive with our names.

Don't you think.

But I'm just going to leave it like that because I just like the name and we are different.

Right we're using a modern browser and we are coding the mail.

So this is awesome.

But anyways so we're going to actually name this document right here.

Universal.

And now the first thing that I want to learn about right.

Well actually I want you to learn because I already know this stuff.

All right so we're going to go to the body bag tag here which is the visual area or a document.

And we are going to be typing in a comment.

First of all right no that let's you explain about why space right why space is super simple to explain

why space is basically ignored in the mail.

What do you mean using nor Edwyn.

Well what are you talking about.

Well let me just put it like this.

Let's make a p tag right here.

Let's open a pizza and closer right.

And let's just say this is a sentence right.

So there we go.

Thought I got to finish a sentence like this.

And let's go ahead and put another paragraph down there.

And it's just called it.

This is another sentence.

Another set.

There we go.

Let's click on the lightning bolt see symbol here.

I can whatever you want to call it.

And as you can see right here we do have a space.

Right.

Because we already have some default styles right for the p tag for pantograph tags.

But look what happens if I go ahead and bring this down in my Enter key all the way down to line 22

and save it.

Look what happens to this here.

Refresh.

Nothing because that space is ignored by the mail you need to tell the you need to tell this browser

in this document here that you won a break.

You want to break the line write a line break.

So that's exactly what we are going to do.

I'm going to put all this this all the way up and I'm going to show you the example of using a line

break right.

So the line breaks super simple.

That's it this tag right here Coleby for which it stands for break is going to break the line or is

going to make a new space.

So I came for demonstration purposes only.

I can put them right here for my own self actually.

All right but I can put it anywhere I want to be honest with you.

That really doesn't matter.

Like I said whitespace doesn't matter the way the browser sees it is it's all new line break.

All right.

So even if I pool this this all the way up down the browser sees it as is over here and if I put this

here the browser sees that after this paragraph tag it has to break the line to a new line you have

to create a space.

So that's what the browser sees.

I'm going to show you as you can see right here we have a new space there now working.

We're heading create another one.

Put in the next line as you can see it is moving automatically.

There we go.

See that.

So now what I want to show you are one should.

If you have this close I want you to open it up.

You put your mouse over and you can see there's little arrows going from the right to the left just

drag this right because I want to show you something.

You see this little dot right there on the universe.

I actually made in the working section right here.

That's because it is not safe.

Watch what happens.

Keep your eye on this dot.

Watch what happens when I when I press command or control as I see that it does appear right.

Completely.

So if I move my this again there appears again that means is not saved.

So make sure that your father is always safe.

All right.

So now the next thing is a comment.

So how do we create a comment on a system.

Super simple and what a comment said.

I mean what is the right way.

Well comments are a way for us to not display certain code for our code not to be executed by the browser

because we don't want the browser to secure a comment.

A comment is just to write some documentation about specific code right.

So let's just make a comment let me show you the syntax and let me give you a better explanation after

this.

So the left angle bracket exclamation just like the doctype and too high fence.

Right.

And what this this is going to do is going to comment everything underneath as you can see the coeditor

already grade this out to another color meaning that is already commented out.

Just like these numbers right here.

Right.

Of course these numbers are commented on by the full Did they really don't matter.

I'm just giving you an example.

So now what we want to do is because I want to show this paragraph.

All right we need to close these.

We need to close this code right here or anywhere else before before here.

All right.

So hiving hyphen right angle bracket as you can see these goes back to the normal color.

Am going to save it come back here as you can see now that space is gunnies him.

He has no more space now and this is actually the original size of the screen.

I just got it up.

Zoom in so that you can see it.

So now it's better to put it like this here because it looks better right.

Now let me show you what a comment is actually really for besides commenting your code that you don't

want to use.

All right.

You can make you king.

We use a common to actually say the comment below.

Displays a paragraph right.

Now if we were using some other you were doing something else maybe in javascript or Jake where we are

something else.

In this age the male page you were right something like on the date of 2020 I made the code below to

fix the error on the page or something like that or I the image to the right.

Right is I made the code below to float the image to the right because it didn't look good on the left.

So basically you use the comments as documentation for your own use and for other developers.

All right.

So that's why you use comments and sometimes I use commas just to comment some stuff out and I'm going

to select everything and use command for a slash on my coeditor and he does that for me as you can see

or control for Slash.

And this is a forward slash right.

So when you do that when you select everything and you do that you can select everything at the same

time so you can do that and you can also do command Z or control Z to undo everything and going to do

it again command Z.

I'm going to do on do everything that we go see that couple of times and do everything again and save.

So sometimes I don't want to use certain code and I say you know why I don't want to use this.

For example this paragraph I'm going to do this and I'm just going to use this new one and I leave this

here so maybe later on I want to use it again.

So I just go ahead and comment this by using the same key word shortcut again and then I comment the

one below out.

All right.

So just to give you some cold laid on or to make a documentation with it and within our specific document.

So that's why you use comments.

Right.

So this lecture here we learn about why space line breaks in comics.

Thank you so much for watching my lectures and hopefully you'll learn a lot on this one.

And looking forward to see you in the next one.

Good job if you follow me.

See you in the next one.

   
您的大名:
万水千山总是情,给个打赏行不行。 打赏
本文经授权后发布,本文观点不代表立场
-- 展开阅读全文 --

作者信息

Royal
文章 17 篇 | 1.2k 阅读
最新文章

随机推荐

广告

热评文章

146 ms