html guide

this is like a year old a very outdated. However it don't do a half bad job of explaining the very basics of html and website building if needed

Hyper-Text Markup Language

markup languages dictate the general structure and format of a document. html is designed for websites, and can be used with css and javascript (among other tools) to make fully-featured and professional looking web applications

html guide site
Color picker on same site
oops!
                                                                                                                                                                
                                                                                             ''                                 '                               
                                                                                           ::jQ'.'    ';:: .                     ;j                             
                                                                                      'j. .@gq:aQ 2  :j2N @g@2; .'   ..           ;::'                          
                   .                                                              ': jgQN:Z:::j_j;@a:Q:@:::::@,Q::;.j:Q:'  ;. '.'  '2j:;                        
              '   :j;.  '.                           :'     :                 ''';:@QQ"::p:j\"jj22@pz@""::j:":":@QzazzZN g.ajj'.;..  ;2jj.                      
           ''.;';;j:Zz  ;g;                          j.   ;;j..         ''    jp.:2:":juj::jj2a2aj:".:j2{jj\{"\{.:@@Zz@::zZaaz:::..' ';;;j.                    
       ;'.'.':;jj2QQ::  Z:j'                       'zza.'j@QNN2       '.:'  ;az@j;{j2"ja2"2j22:zzz2ajj1g2u22z2jjjjj:"::::.:qQ@Zj::;..' .''.                     
       :':;;.j:gZ@@":::.q:@a          ;'..;;.;.     ::@2;z@@@:g'' '''.jg2;;j:Z::ujjz:gzza\a:QQQQQQ:g2zz:zza2aaj2jjjj{j:::":@::,:z:2gj::.'';.;.                  
       :;j.;;2;g@::"j\pgqj:.@2     .' :j;.::;      ::"::.:"j:"@Q2;:j:;z:ZQN,z:::2jzQQQQQQa:QQ@@NNQQQ:zzz:Q:gaza2aa2c2j\"{j":@::::@ZZ2j::azj;jj:.        '       
      .::gj:jNgN@:j\jj\@.{2j\;,'   :j:jQQQZ22.      "jjj""jj_a:::@ZNN::::\2;:j2:z:QQ$@QQj:Q$@j@@@@@@N::QQQQ:zzzauua2uuj"\jj::"""\::@@@NQNQgNgZjj:'              
      '::zj:Q@Q@:"j2j22:jjzaj2jj.;'.jzQ:::"_:,: '';N\2aj"2zazaj\::Q@:j{j\ja:jzg:Q$@j@jjj\$@$jj@jj@@j@QQQ$QQQQ::gaaauu222jj"\@::"""j:\:@:::@@::@@z:j.;:          
       ':Zg:@@@@:\juaaa\jjagzgz\ZZ@,::::j:jjj"g:jz:@zzza2zgzg2z2j::jja22ju:QgQQQj@jjjjjjj@@@jj@jj@j@@jQ$$@@QQQQQgzzgz2u2a2j"\:"":"::{"::::::::@@@Na:jgN2        
        ;a@Z::::"\2aazzzazgg:Q::_:\":jj\jjaa1j:2q::\2:gz2::Q:::zz2\2g::gau@$Q@@jj@jjjj2jjjj@j@jjjjjjj@$Q@Q$QQQQ:QQgzggzz2j22jjjj;j\\""j"""::::@::@gQj2gz2a:'    
         ;g@:"{:j\2azzg::::zQQQQQ_2jjjjaaaz::uj:"\;juQ:gaQQQQ$Q::njzQ$QQgQ@@@@j@jjjjjjjjjjj@@@@@@@@$@@QQQQZQQQ:::gggagzgzzaaaa2azaj"jjj":\@::::::@@NQQQjjjj:.   
         'z::{\jjjuazg::QQ:QQ@@@@Q2:2:Q2:2:Q:n2jj\zjaQ:QgQQ@j@$$NQ::$@@QQ@@j@j@j@jj22j22jjjj@j@Q@Q@QQQQg:gz::::azzajj2j2auaaaazaza2aau22j:"::::::@:@@:@QjgQz:'  
         '2::j:"jjjazz::QQQQQQ@@jNpQ:QQpQQQQQQ:a2jonagQQQQ@@j@$$@jpQ@@j@Qjjjjj2jjj2jj2jjjjj@$@@jQQ$@QQQ:gaz::::gg22jjjjj"\j\jj2aaaa222jj:{:::::::::Q@@@@QZQ2j'' 
          jZ@::::"jjjzzgg::QQQQQ@@@QQQ\QQQNQ@pQ::z2Qz:QQQ@@jjj\j@j$j$j@@jjpjjjj2j2jjj2jjjjj@j@@@jQ@QQQQQQQ:QQQQQzz222jj{:::\j{;"j\jjjj{\:::N@:::"::Q@QN@ga:j:' 
          .g@:@:::""2jjazg:QQQQ@@@@QQj@@$Q@@@$QjQ:Q$:QQ@$@@jjj2jjj2jjjj2jj2222222j2jjjjjjjjjj@j@@$$QQQ:::QQQ:Qgzzzza2jjj{j::::::@NQ::::::@:@@:::::"":@::@ZQZa:.'
           zZjaN::j{jj2aaa::::QQQ$@@j@jj@@j@jjjjjpQ@Qp$Qjjjj2j22222222j2222aua222j2j2j2jjjj$A@@@QQQ::gzg:Q:::z:gza22jjjj;j:j\":@@pQg2Z:::Q@@:::"j"j":::@:NQNa:; 
           ;:jjQQ@\j""jjjjag::QQQNN@@@j@jQjjj222j2jQj2jj@2j222aaaauzzauazazz222j2j2j22jjj@QN$$j@@$QQ:ggzg::::Q:::au22ua2a22;jjjj"{::::@::::::"j"j\:""::@N@ggj; 
            .2Q:"j:"::2jj2zz::gQQQ$@@j@jj2jj22222j22j@22\j2aazzgzzzgggzzzzgaaau222aa222j@@@@$@@@@QQQQQQQQ:QQ@pjQQQQQQ:Q:2:gQ:zz\2jjjjjjjjj{\{jj{"\:\{\"::Q@Qa:;.
            2Z@:"\\:jjj{zazzgQ:QQQQQQNN@jjj222222u2a2ja22ua2azggZZgQzgZgzzzzaza222zaa2jjjj\j@j2jjj$@Qj22222222j22jjjj2jjj\Q\QQQQQQ$QQ:gazaaj2jjjj\""::"::Q@Q2:;'
            2:\jja2::2Q:QQQQQQQQQQQQ@Q@@@jjj2222uaauaz2zuazzgggggQgZZQZQgZzzzza2zgazz222222uuu222j222M"R"RRRRRYRKBMM@@j@jjj@j@@@j@@@$N$QQQ:g:zzzjjjjj"\::@@Zj::'
             7j2z::QQQ@$@@Q@@@@@@@jpjQ\jQjj2j2j2aaazzazzgzgzggZQZZZQQZQQQZZgZggzzgzzaauauuuu22jjB5\:@:::;::@@@q::Qa@@::::""=HAj@j@@j@jN@@QQQQQ:zaa2jjj"\:@@gj:: 
             '#2z::::gg2>">>"-""#7-="o0V#@jjjjj222aazzgzzggzgZZZQQQQQQQZQQQQQQggggggzaauu22jjMc2222jj"\._.:Q_Q:_;@:.';#--:j\__\7A@j@j@@@@@$QNQQ:zu2ujj{::@@Zj.;.
              '#jzggga-@2z:; '.___._za2_.2-"K@@jj222azzzaazgggQgggQQQQQQQQZQQQQZggzza222jj@A:2uQp:\_Q22pQjjjjj@$Q\;. :..__7-jzaajaK@j@j@@$Q@QQQQzza2jjj:::@2:;' 
               j#":zy>#; _;ag:QQQ$jj2jj@@Quj,7=Z@@jj2uaazzgzggZZgZQQQQQQQQQQQQQggzza22j@@QQQ:Q2QQj22azar:@j\\jjjpp:2\:{@$QQi_Z7"jagQ$@j@@@@$Q$QQ:zza2jjj::@Q2:''
                Q:jj:jj2qjzgQ$@@Q@@jjjjQ\QQ:z2:1Qp@Q@jj2azggggZQQQQQQQQQQQQQQQZgzz222jjQQQNQ2M:@@j2zzZQg2jja2u222j:u;.j2@$y{::.@{jj:QQ@j@@@NQQQ::zzz2j{":Qg2:; 
                :@:\j":@aN:uQjjj22j@@jj2u2j$Qa:j2j:uQZQjj22azggZQZQQQQQQQQQQQggza22jjj@QQQQ2fjzZjj2zQQZQQQgaua22jj:Q2aujKC\"\j2juaag:zgg:Q$Q$QQQ:gzza2jj\::jj:. 
                'Q""j:::@zQ-K@222aa2j2ju2jjQQj2jM9>-"::Q@@j22azgggZZQQQQQQQZZgaauuj2j@jjjjj\L_..@-"VMo&gQQQQQQgggZgx2M8"jj2a2azzzzzzzzzzg:QQQ:Q:ggga2u2j":@z2.' 
                 Q:\jj\j::@N:"GMj2azgzggu2j@MB0:.___QQ:QNQ@@22azzzgZQQQQQQggzau2222j@@jjjjjj2jjjQ::cajj2uKMMM"MMA0oj:j\:222QQQ:::zzaaaaazzz:::Q:gzzaa2jj"::Zj.' 
                 a:{jjj2jj;j:;::::"oo4&ojjj::::QQQjj@QQQQQQ@jj22zzgggZQZgZgza222jjjj@Q@@j@@@@jjjjj@Qj$QjpQQ\p:::QQQQQQ:QjQp$QQ:gzzazaaaazgzzg:::::zzaujj"::Qz:' 
                 .:"222jjj2za22\2j\22:::Q@@@@@NQ@@$QQQ:g::Q@$@j2uaaggzgZggzu22jjj2jj@NN$@@Q@NN$Q@jjj@jjjjp2jj$$q222$jjQjj@jQQ:ggzazzzzz:z::::Q::::gza2jjj::@jj. 
                  :"22aazzzza:QQQQNQ$@Q@@@@$N$Q$QQ:ggzagzgQ:Q@jj22aazzgzzza22jjjj@j@j@@Q@Q$QQNQ@@$$@jjjjj2j22u22u222jj2j@@@NQQ::g:g::::Q:QQQQQQQQ::zz2jj"":@a;  
                  q"j2azzzgg:QQQ@@@@@@@@@$QQNQQQQ:gzaagggggg:$@@jj22aaazau2u22j@jjjjj@@@@N$Q@$$$@@$@@@@jjj2jj2222jjjjj@@$$$QQQQQQQQQQ$QQQQ$QNQ$QQQgzzajj::@@Z:' 
                  :"juazzzgg:g:QQQQQ$$$NQQQQQQQQ::ggz::::::QQ$@@@j22222uu2222jjjjjjj@jjj@@$@$@@j@@@j@jj@jjjjjjjjjjjj@@@@$QQQQ@QN$Q@Q@@@j@j@@@@@$QQQgaa2jj\::Zj' 
                  ':j2aazzzgggg:::Q:QQ:QQ:Q:Q:::::::QQQQQQ:QQ@@@jjjjjjj222j22jjjjjjjjjjjj$jj@jj@jpjj@j@jj@j@jjjjjj@j@jj@j@@@Q@@@j@@j@jjj@j@j@@@Q$QQgauj2j":@@Q. 
                   zjazgzz::zggzg:::::::::::Q:Q:QQQQQQQQQQQQ$$$Q@@@jjjjjjjj2j222j222222222jjjjjjjj2jjj@j@jjjjjj@jjjjjjjjjjjjjjjj@jjjjjjjjjj@@j@@QQQ:za22jj::@Q. 
                    :2azgg:g::Q:Q::QQ:QQQQQ:QQQQQ@@@@$N@N$Q$$Q@$@@@@jj@@jjjjjjjjjjj222222222222jjjjjjjjjjjjj2jj2jj222j2jjjjjjjjjjjj2j2j2jjjjj@@@@QQ:gaauj"":NQ; 
                    2jagg:::Q:QQQQQQQQQQQQQQ$Q$$@@$$@N@@$$$QQQQQQQ$@$@@@@@@@@j@j@j2j22uaa2a2uu222222j22j222j22222222uau222222j222222222jjjjj@jj@$QQ::zz22j"@:Q: 
                     #2zz:QQQQQQQ@$$@@@@@$@@$@@@@@@@@@@@@QQQQQg:QQ$Q$@@@@jj@@@@$@@j@jj22uaaauu22u2u2u22uu2uaa2u22auuaaaa2aaaua22uu2u22222j2jjj@@QQQ::ga2j{:@@a. 
                     .:agg:QQQQ@@@@@j@j@@j@@@@@@@@j@jjj@@QQQ:zgg:QQQ@@$@@@@@@@NQQ@Q@@@j@22aaaaaaaaazuaaaaaaauaaazzzzzazzzzgzzzaa2uau2222jjjjj@@@@Q::zau2j"::@j' 
                      ::uz::QQNQQ@@j@@@@@j@@j@j@jjjjjjjjQ::gzaz::QQ$$@@j@@@@@QQQNQ@N$@Q@@@2uaaaazazaaaazzaaazzaazzzzazzzzgzzzzzaau2u2222jjjjjj@@Q::zaujj::::Q2  
                       .:ug:QQQQN$$@$@j@j@jjjjjjjjjj22j@Qzzajau2g::Q$@@@@@@QQz2a:::ZZ:Q::QQAjuazzzzzzzzzzzgzzggzgzzaauazzzazzzzaa22u222j2jjj@@@QQQ:a2jjj"":Na.  
                        .-j:g:QQQQ$N@@@@jjjjjjjjjj22222@:2;jjjjaz:QQQQQQQQQgzz\auau"j2u22j2uQ@2azzzzzzazzgzgggzgzggzzzzzzzuaaauua2222jjjjjj@j@$QQzza22jj"":@j   
                         .-az:::QQQ$@@@j@jjjj2222aaaaa2@y;j::jj2zz:QQQ::Qg:azzza2j;jjj2j"jj2aQ@jazzzzzggzgzzzgggggzzgggzzaaaua2a2222j2jjjjjj@QQQzzaza2j{:::Z    
                          .7"gg::QQ$@@@jjjj22222aaazza2pnj;222ag:g::QQQQQ:Q::QQ::::caaza22222a:j2uazzgzggzgzgggzgzgzzzzzgzaa222222j2jjjjjj@@$$Qgzzzza2jj\:@:    
                            7-uzg::::QQQ$@@jjjj2j22222jn2gzgz:::Qg:QQQQQ$$@j@@@$@@@QQgga2222juZQjj2aauaaazaazazaaaaaza22a222jjjjjjjjjj@j@@@$QQ::gzzzu2jj$:g     
                              :#7---""""3"oCoo0Co00000>##:-""j""o"C"oouuS&g&sss&oSo&2j\"::"#::"ooo&ssKKMAA@A@AMAM@MMA@AA@KAsAAAQ:Ss&sg::&gzzoo2jj"j\:":#@:      
                                       '. .           :  ...  . '  ;.'':::' '' '..;.'..'.     ..;::j:j277-N7#--#-#27###--#-#-##77Ng77Z77zg27aj;;;::..;.'        
                                                                                                                                                                
                                                                                                                                                                
                                                                                                                                                                
in a nutshell

<tagname>content goes here</tagname>

html works sequentially, it will execute the code starting from the top and going down

where to edit html code

the easiest way to do it is just your operating systems built in text editor (Notepad, TextEdit, Nano), but its not the best place to do so. there are lots of text editors that are made for programming. here is a few to consider:

almost everyone uses Visual Studio Code (i use it to); its considered the industry standard. But there are still a lot of professionals how use the other editors, so give them a try (they're all free). Any text editor works as long as is it can open a .html file as text

˜”*°•.˜”*°• BASICS •°*”˜.•°*”˜

simple stuff to get your feet off the ground

where to start

doctype represents the document type and makes it easier for browsers to display the website html specifies we are writing in html (will need an end tag at the very end) and lang=en lets web browsers know this is an english site. if you are not writing your site in english, you can use this table to find the code for your language

body

the body is everything visibly displayed on the site. you can also add style attributes (more details later) like background color or background image

paragraphs

This is a paragraph.

puts text on your website! paragraphs also have a margin below and above it, whose size can be edited with css
you can also use <br> to break the line within the paragraph

headings

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

headings are basically paragraphs, but with bold and text size built in

lists

formats lists
"ol" stands for ordered list, but there is also
"ul" - unordered list - and
"dl" - Description list

  1. item one
  2. item two
  3. item three
item one
this is the first item
item two
this is the second item
item three
this is the third item
Comments

comments will not be displayed on the website. they are for the programer to help organize or write notes for other programers also working on the file

Tables
first row, first column first row, second column first row, third column
second row, first column second row, second column second row, third column
third row, first column third row, second column third row, third column

creates a chart, structured by rows <tr>. <td> defines table data within each row. you are not restricted to only having three of each. you can have as much as you like

text text text text text
text text text text text

˜”*°•.˜”*°• ADVANCED •°*”˜.•°*”˜

not too hard, but a step up

Block and Inline Elements

html has two main types of elements:

block elements

block-level elements start on a line, are given margins and stretch to the full width available. block elements can contain inline elements. the most used are <p> and <div> (div is like a container). here are some others:

inline elements

inline elements do not start on new lines and only take the space they need. they can not contain block elements (they go in them). the most used is usually <span> (container for inline elements, like div). here are some others:

Inline Text Attributes

bold text
italics text
strike-through text
subscript text
superscript text

adds text formatting that can be added within (inline) another element. It dose not make a new line and only takes as much space as necessary if all the text is gonna be the same, you don't need to add <p>

there is also custom attributes that can be defined with css. but without css, they default to this:

strong big em dfn var mark ins del small kbd code samp type

Images

the img tag is used for displaying images on your webpage. the tag itself holds no value, hence the lack of an end tag. images contain two main attributes: "src" and "alt": "src" contains the url to the webpage (url could be from different a server, but usually from the same sever that hosts the website) if its in a folder, include the folder name

Image didn't load. pretty awful example

"alt" contains text that is displayed instead of the image if it fails to load

Image didn't load. pretty great example

you can specify the weight and height either using a style tag or separate weight and height attributes (measured in pixels)



the picture element can store multiple images,but only displays one. to display an image based on the screen size and if the browser does't support an image type

example for image size (same works with audio and video)

example for image type

marquee

marquee is scrolling text

marquee is fun

there is a lot of attributes that can be added to marquee. like direction

marquee is fun marquee is fun marquee is fun marquee is fun

direction="right" - direction="down" -- direction="left" - direction="up"

scroll amount changes the speed that it scrolls

marquee is fun marquee is fun marquee is fun marquee is fun marquee is fun marquee is fun

you can add width and height to make boundaries. behavior could be used to make the text bounce back and fourth; behavior="alternate." scroll delay adds a stutter effect to the scroll (only works if its over like 60)

marquee is fun marquee is fun marquee is fun marquee is fun marquee is fun marquee is fun
Styles

background color

text color

fonts

text size

text alignment

border color and width

everything

styles can be added within an element to change its appearance. style is just css. you can get crazy with css, and we'll go crazy later, but here is some simple stuff to get you started. also, note that color (for all of html) is picked with hexadecimal codes, RGB codes, HSL codes or one of the 140 color names
style info can also be stored in the head

html has no fonts built in. your web browser will usually provide three fonts for you to use (a serif font, a sans-serif font and a monospace font). what specific fonts you have depends on your browser and your operating system - refer to this site. to add custom fonts, the simplest way is to use fonts.google.com. find a font you like from there how add it in the head with link

background images can be added with style

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

TEXT

text on image

you can add attributes pertaining to the background image

repeat and size are exactly what you think they are (repeats the image if you run out of space on the image; adjust the length and width of the image). attachment is about whether the background image scrolls with the rest of the page or not

values for attachment

Value Description
scroll the background image will scroll with the page. This is default
fixed The background image will not scroll with the page
local The background image will scroll with the element's contents
initial Sets this property to its default value
inherit inherits this property from its parent element
Iframes

iframes display a website within a website!

<iframe src="url"></iframe>

most websites use something called "x-frame" to not allow other websites to use it as a iframe (to prevent clickjacking). there is not many sites that allow it, but here are some i could find:

html on same site youtube open street map metro blue spotify

as you can probably guess from their ui, these are not the normal versions of each site. these are special subdirectories made to be embedded on other sites. These are setup on their respective website (for example, on spotify's desktop site, you can go to the options on a song --> share --> embed track, which will bring up a ui to make an iframe for your site)

you can specify height and width (same way as images) as well as border (with style. having a border is default. you need to write border:none; to get rid of it)

you can make a link appear in an iframe using the name attribute. you write the name of the iframe in its syntax, and then use that name as a target in a hyperlink

Meta Tag

meta data is not displayed on websites
the meta data used with the meta tag is for information for the browser to help display everything correctly

"charset" defines the character set your using (if you don't specify, its automatically UTF-8). Character sets are lists of every number, letter and symbol you can use. UTF-8 covers almost every character in the world. I would only change it if your website is intended for old computers that don't support UTF-8, or you are primarily typing with characters from an asian or african language, which are not optimized well on UTF-8

keywords are search terms for web browsers to use for looking for your website
for example, if your website is for your legal practice, you would want keywords of law, attorney, etc

specifies who made/maintains the website

viewpoint allows for your website to scale with the screen size of the user

Semantics

semantic tags are basically tags that already exist renamed for organization. for example, <section> is functionally the same as <div>. it is only named section to help the developer organize and the web browser display correctly

other examples are header, nav, figure, caption, form, article, aside and footer. again, they all work the same as div, but are used to organize sections. its recommended to use them this way:

text displayed if image doesn't load
Etiquette

like in real life, coding also has manners to abide by and like real life, you don't have to follow them (i don't follow them all) but if you want your code to be tidy, clean and not make pedantic people mad, you should follow them (there is no downside after all)

DISCLAIMER, some of these are done automatically with a formatter, so get one

closing elements

you technically don't have to close all elements in html

is valid html code. but it is strongly recommended that you close them for organization

lowercase

html lets you use both uppercase and lowercase for elements and attributes

but developers always use lowercase because its easier to type and looks cleaner

quote values

html lets you attribute values without quotes

but developers use quotes out of habit since they are needed for values with spaces

images

you don't have to add alt, width and height attributes for images

but, they add clarity if it doesn't load, and reduces flickering while loading by reducing space

equal signs

you might assume its good to add spaces around equal signs

but developers prefer no spaces for easy reading

blank lines and indentation

if you really wanted, you could organize your code as one big block

but developers use spaces and indents to help organize their code

there is no best way to use spaces and indents; different developers use them differently. nowadays, most developers have a code formatter that will do all this automatically. i use Prettier, which formats everything when saved. i actually wanted the first example to be messier, but Prettier wouldn't let me

omitting head, body and/or html

if you forgot to use the body, head or html tag, the browser will add it in for you. but you should still use it anyways to organize and give the browser less work

miscellaneous

a bunch of things worth mentioning but aren't big enough to warrant they're own section

bi-directional override

the <bdo> over rules the current text direction and lets you set your own. this is mainly used to reverse text or to help format languages written right to left like arabic or hebrew

this text will go left to right
this text will go right to left

the <bdi> tag (bi-directional isolation) is for formatting text in a different direction then the text around it, like if you were writing arabic in a english paragraph

a tree starts with a seed (أول الشجرة بذرة) is a common arabic proverb

details and summary

details adds a widget that can open and close additional elements

this the summary give it a sec

you can put whatever you want here

dialogue

the dialog tag makes a box that floats above all other elements. it must be open in order to be seen. this looks useless but it is extremely useful for making pop-ups with javascript

paragraph text. nothing to see here

This is an open dialog tag

paragraph text. nothing to see here

paragraph text. nothing to see here

paragraph text. nothing to see here

entities

some characters are reserved in html. if your try to use < or >, your browser might confuse them for tags and not display properly. for this we use entities. you can use a entity name or number to display these instead.

entities names look like this &entity_name; and entity numbers look like this &#entity_number;. here are some of the most common:

name number what result
&nbsp; &#160; non-breaking space  
&lt; &#60; less than <
&gt; &#62; greater than >
&apos; &#39; single-quotation mark '
&quot; &#34; double-quotation mark "
&amp; &#38; ampersand &
here is a reference list for all of them

horizontal rule

the <hr> tag makes a horizontal line


thats it. it can be styled to

meter

the meter tag will make a gauge icon filled to the known values in the range. if a min and max aren't specified, they are assumed to 0 to 1



the progress tag works identically to meter except it can be used with javascript

preformatted text

the <pre> displays text that is preformatted and will keep all extra spaces and line breaks exactly how it is displayed in the code

        ,
        (`.  : \               __..----..__
         `.`.| |:          _,-':::''' '  `:`-._
           `.:\||       _,':::::'         `::::`-.
             \\`|    _,':::::::'     `:.     `':::`.
              ;` `-''  `::::::.                  `::\
           ,-'      .::'  `:::::.         `::..    `:\
         ,' /_) -.            `::.           `:.     |
       ,'.:     `    `:.        `:.     .::.          \
  __,-'   ___,..-''-.  `:.        `.   /::::.         |
 |):'_,--'           `.    `::..       |::::::.      ::\
  `-'                 |`--.:_::::|_____\::::::::.__  ::|
                      |   _/|::::|      \::::::|::/\  :|
                      /:./  |:::/        \__:::):/  \  :\
                    ,'::'  /:::|        ,'::::/_/    `. ``-.__
displayed with pre  ''''   (//|/\      ,';':,-'         `-.__  `'--..__
                                                            `''---::::'
      

, (`. : \ __..----..__ `.`.| |: _,-':::''' ' `:`-._ `.:\|| _,':::::' `::::`-. \\`| _,':::::::' `:. `':::`. ;` `-'' `::::::. `::\ ,-' .::' `:::::. `::.. `:\ ,' /_) -. `::. `:. | ,'.: ` `:. `:. .::. \ __,-' ___,..-''-. `:. `. /::::. | |):'_,--' `. `::.. |::::::. ::\ `-' |`--.:_::::|_____\::::::::.__ ::| | _/|::::| \::::::|::/\ :| /:./ |:::/ \__:::):/ \ :\ ,'::' /:::| ,'::::/_/ `. ``-.__ displayed with p '''' (//|/\ ,';':,-' `-.__ `'--..__ `''---::::'

ruby annotation

ruby can add small annotations above the main text, primarily for indicating pronunciation or meaning. ruby defines the main text and rt defines the annotation

this is the main text the is an annotation
scripting

the script tag adds embedded client side javascript. incase the user has javascript blocked (pretty common), there is the noscript element that displays instead. javascript is the programming language of the web and is used to add code and applications to websites.

<script> document.write("this was written in javascript!") </script> <noscript>your browser does not support javascript!</noscript> template

the template is a container that is hidden until displayed by a javascript function
I would show you an example but i don't know enough about javascript to make an example or get one to work. trust me that its a div but hidden that you can display with script

title attribute

the title attribute adds a tooltip to the text. a tool tip is a little text box that will appear after hovering over it for a bit

this text has a tooltip

<wbr>

<wbr> defines an optional line break. <br> will break the line, but <wbr> will break if word wrap thinks a word is too long and makes an awkward break

˜”*°•.˜”*°• FORMS •°*”˜.•°*”˜

collect data from the user!
(this is barley complicated enough to have its own section)

form elements

form is a container for different types of form elements. some of the more important elements we will go into detail with later, but here is roughly everything you need to know about each

input

input allows the user to input data, with different types of input. Its the most used forum element and we will go in to detail about it later.

label

labels are for screen readers to read out the content of multiple form elements. the for attribute should be the same as the id of the form element to attach them together

Selection

select makes a drop down list from the user can select their input

if you want an option to be pre-selected, add the selected value to the option

Text Area

text area is like the text input type but you got to define the area with rows and columns

Datalist

datalist sets up a predefined list for inputs. the id of a datalist would be the list value of the input

input

the primary method of receiving data from the user is with the input tag.

input tags are are made up of three elements: type, name and id. type defines what type of input it is and how it can be inputted, name defines what the inputted value is called and id is for referring back to a label tag (take about later). there is also the value attribute, who changes function depending on the type but is usually the default value inputted if nothing is inputted.

the password type is the same as text but the type field is masked with asterisks (for passwords and text, value defines the default value)

buttons let you execute javascript with the onclick attribute (value defines text on the button)

the submit type is a button that sends all the user submitted data in a form to a form handler. the location of the form handler is defined in the action attribute






the image type also acts as a submit button but with an image instead

there is also the reset type, a button that will reset all form values back to their defaults

the hidden input actually isn't an input at all. its to put other values to be submitted with the submit button

Radio buttons are used for selecting one thing from a group of things (name must be the same)

a
b
c
d

if you want to be able to select more then one boxes, you use check boxes

a
b
c
d

input type "color" adds a color picker

"date" is a date picker. you can also add max and mins to make restrictions

"datetime-local" adds time to the input

"time" is only time input

"range" adds a number input where the exact value isn't to important (slider). default range is 1-100, but that can be adjusted with min and max. there is also "step" which changes the intervals the numbers go by (step="2" would make all the numbers even)

"file" opens the users default file manger to choose a file to input

all the rest of the types are text fields for specific things to be entered in. You may assume that they are like semantic form elements. But no. if you don't enter what the field is defined as it won't go through

Input type Contains
<input type="email"> Email Address
<input type="tel"> Telephone Number
<input type="url"> Website Address
<input type="week"> a Week and a Year
<input type="month"> a Month and a Year
<input type="number"> Numbers
<input type="search"> used for search fields
input attribute

the "readonly" attribute to make an input field uneditable

the "disabled" attribute dose the same while also making it un-clickable

the "required" attribute makes the user unable to submit unless its filled out




the "size" attribute specifies the length of the text input area (size is 20 by default)






the "maxlength" attribute adds a character limit for the input field


as mentioned before you can use min and max attributes on inputs regarding time or number to add limits

for file and email input types, you can use the "multiple" attribute to allow the user to make multiple inputs

the "autofocus" attribute will put the curser into the field when you open the page