Elements are everything we use while coding in html.It comes together from tags which are every code.
For example;When we want to have a headline, we have 1 to 6 options like h1 to h6.
These options help us to have different-sized headlines. H1 is the strongest one, and h6 is much closer to normal typing size.
Let's check the headlines together:
and this is the typing in normal size
When we want to have a line we type as < hr > and this is a self-closed tag. So, we don't need to close the tag after using it. If u want an example about this u can check the green line above.
We can check the different features that we can create with hr tag in mdn. When we check the mdn, we see that there are some features like:
Only thing that we need to do is open a tag and color=" writing the answer"
that's all.
This tag is a self-closed tag, so again we don't need to close it with /. Also, the only thing we need to write is < br > to end of sentence
and that's all. For more details, u can check here. Also, u can do the same thing with closing the paragrph tag before and openning again in the same line.
When we want to list things in an order (1-2-3...), we need to first write: < ol > in continuation < li > and < / li > should be written and then, of course, closing the ol tag: < /ol >
If we don't close the ol part, we can add so many things after the < li > tags. For example; I'm adding links, and sentences after using these tags.
To learn much more about the ol please check here. and to learn more about li please check here.
When we want to list things in an unordered way. We need to use < ul > and then < /ul >. For the details about these lines, we'll meet again. To learn much more about ul please check here.
< em > is a tag that helps us to make our text italic and when we use the em tag we need to close it, unlike the self-closing tags.
For example this
To learn much more about < em > tag, please check here.
This linking style is different from other. Firstly, you need to have a title with h2 to show that it opens a new web page to your website. To do this let's open a new file on our visual studip html file.
After having a new file, we need to enter the html:5 codes like we did in this file.
After filling our new file, we need to link that file to our main doc. like this:
< img src="writing the name of doc.(which will help us to display)" alt="writing the name of doc for noticing it">
To change the color of h an p tags, we need to firslty focus on the openning tags.
When we enter the opening tag as: < p style="color:thecolorIwanttoenter;"> Write whatever u want p>
Table is an important thing to use in html. There are three different sub table tags such as:
This one helps us to define a set of rows defining the head of the columns of the table.
This element defines a set of rows defining the head of the columns of the table
It helps us to summarize the columns of the table.
For example;
Phone name | Phone model |
---|---|
Samsung | Z flip3 |
Iphone | 14 plus |
Total | Two phones |
To add a borderline to a table, we need to open a table element and before closing the opening element write border="amount of pixels" and close the tag
For example
< table border="3" >
< tr > HTML element defines a row of cells in a table. The row's cells can then be established using a mix of < td > (data cell) and < th > (header cell) elements.
How to use tr:
Name | Loves | Doesn't love |
---|---|---|
Elif | Loves | |
Filiz | Doesnt love |
Instead of using tbody, thead or tfoot, we can just use tr. After writing tr, we can just use th for the headings, and use td for the regular texts.
To have forms we firstly start with < form > opening element and start to use any label or input that we want
For instance, if I want to have a calendar on my website, I'm gonna type these elements: