Sunday, June 18, 2023

Programing tags Js and CSS they are different

And the script could came in the head.  The structure is an tag informing that is an HTML doc. and after an tag that is the HTML tag and goes inside this tag:

The head and other that is the body, and all goes inside this two one, so if something is inside the HTML or is in the head or in the body.

And the tag of dress recomendations, that is like I recomend to you act this way before read that letter, joy.

So if I put an recomendation that is a sparse page to the letter of course is in the head, so is in the head the where is the CSS document that style the document, but of course that you can in place of have an external file of CSS you can write the CSS inside an tag in the head. Also you can write lines of style inside the body that is today the kind of impurify your HTML >>inline<<, But we are talking of addressing of external documents.

So the JavaScript we adress the exeternal document in the head. But of course that we can also write an Javascript in a tag inside the head right in the document HTML, and we can write also the code of JS in the body, sometimes we write the script in the body and sometimes in the head and doesn't work, try cut from the head and put in the body or the opposite, make difference, is because this is a code and the code will run in a sequency so the script be in head maybe would not be run because after the script be read the machine will read the HTML and at this moment the script is like something that the machine will not return is the same that doesn't have a bridge, is like have an script but doesn't make nothing to the document.

So the CSS is <link rel="stylesheet" href="my-css-file.css">

and the JS is <script src="my-js-file.js" defer> </script>

The differences: 1st the tag that had the CSS isn't an special tag for CSS is an link tag, so one moment we gonna have to say how this file work for the HTML-doc so gonna have an rel attribute that doesn' gonna have in the JS, because the tag of the JS is an specific the script-tag. So don't need be equal the attribute of adressing for the link that will have the CSS is href, and for the JS is src attribute. And the value of that adressing follow the rules for the values of that kind is a path to that document. Is a path because could be inside a sequency of folder or even be in host in the internet, is the map of the road to reach this two documents. And the script-tag have one more attribute that is the difer that of so simple the attribute and the value is two in one there you have the attribute with the value defer, is an recomendation that you gonna read the script and hold in your hand because had an hole HTML document to be execute before, isn't that the machine will return the machine is like linear, I think that machine rarely return so this part isn't read after is just this is read and is holded for the machine to an HTML be executed, maybe the machine think that word body?????

Rute Bezerra de Menezes Gondim

No comments:

Post a Comment