status: #doc Tags: #html links: [[html-css]] Date: 2023-07-28 ___ # HTML ## general knowledge ### tag types html describe content of the page with tags we have 2 type of tags 1- normal tag : have opening and closing tag that we must use ```html content ``` 2- self closing tag this tags are self closing and don not need closing tag can be used in 2 way ```html or ``` ### tag nesting you can nest tags like this ```html

the title of my grand site

``` ## Tags ### h tags show titles of web page and order of them as number go up its importance go down or its in lower position in hierarchy there is `h1` to `h6` ```html

This is title of my doc

``` ### p tag use for paragraph of text for grouping some text like in novels ```html

lorm ipson kill the piston

``` ### a tag for linking to another page or to somewhere else in our page we use anchor `a` tag it show test that is inside and when clicked it go to its address ```html google ``` #### a tag attributes - href : for pointing to where we want to go ```html ``` - target : where open this link use "_blank" for opening in new tab ```html ``` ### div tag short for division . it is generic container tag for grouping "like" things together don't do any thing by it self ```html
``` ### lists #### list items ```html
  • first
  • second
  • ``` result:
  • first
  • second
  • #### ordered list ```html
    1. first
    2. second
    ``` result:
    1. first
    2. second
    #### unordered list ```html ``` result: ### [[Web dev/html-css/button|button]] ### img image tag src attribute and optional alt tag for accessibility and google indexing ```html an adorable puppy ``` result: ![[Pasted image 20231227110841.jpg|300]] ### input Browser inputs. Sometimes you need to gather input from the user ```html ``` result: ### textarea Similar to an input but for a lot more text. You'd type long-form responses in here that could linebreaks in it ```html ``` result: ### select and option Sometimes you want to limit a user to a certain group of options to select from. What country you're from, what month you were born in, etc. ```html ``` ### tables Like making a table in Word or Excel. If you have a table of data, this is the best way to display it ### Comments We, as coders, forget what things do. We write things that are really complicated or we know will be difficult to figure out later. Something to keep in mind is that you are mostly writing code for yourself to read later, not for the computer. Be careful of going overboard because comments like `

    Title of the Article

    ` aren't useful because it's pretty obvious that's the title ```html ``` ## HTML Attribute attribute modify how elements in html work we also need space between tag name and attribute and for giving attribute value we do it like this ``` html ` ``` ## quacks in html - spaces between elements and extra space inside tag string are ignored example : this two are same ```html

    test test 1234

    ``` ```html

    test test 1234

    ``` --- # References