You are on page 1of 1
wi3schools.com THE WORLO'S LARGEST Wes DEVELOPER SITE HTML Tutorial HT Base MP ecg ar arrons MT ye ‘MP Forman rv irapes HTML Taiee a tayo MT pone HTL olin Mr Sys HTML Forms ra pu atoes HTMLS MTs peo MTs Mian ruts Se Guo HTML Graphics HTML Media HT ea ht age HTML APIs nut oop rt tol rane mut Arp Cache HTML Examples HTML References HTM Adaeo Mr Doeypes| rt cotrouns rit colrpeter mL Lan Cases HTTP Mecca oyboa Stones Pee Rares cee: HTML Attributes « Previous Next Chapter » ‘Attributes provide adaltiona information about HTML elements HTML Attributes + IML alemants con have attributes + antnbutes provide addtional information aboxt on clement + Attnbutes ore always spected nth 1 terutes come n name/value pa The lang Attribute ‘The document ngage canbe dered nthe poy eurct paragraph. /p> «00» WSSCHOOLS EXAMS ecise MT, C85, Jonas, Poy, an te at exams The title Attribute gestae eo wscootsy nom pave otra sa tterances covering © Fpcloting in, 5, Seabrin, me, sy Me, ASP, et. @ wen you move th moe oer lear, thie il be yd a atl The href Attribute {ITAL Ui are deine with the tag. The lnk adress pected in the he ati: Example ‘You wil lear mare about inks andthe tag lterin this toto Size Attributes [ETL images ore defined with the too ‘The Flename of the source (ste), and the siz of the image (width and height) ae ll provided as attributes: Example [ crs sre-roechoste ipa" wdthent08" eightan16a"> ‘The image size is specified in pees: wil 04" means 108 screen pels wide ‘You wil learn more about images and the ag later this tutorial, The alt Attribute ‘The alt atrbute species an alternative text tobe used, when an HTML element cannot be displayed, ‘The valu of the attbute can be read by “screen readers’. This way, someone "isterng tothe webpage, ie 9 blind peteon, can “hear the element. Example We Suggest: Always Use Lowercase Attributes The RTS stand oes a rei ner caste res ‘The tet canbe ten wth per or wer ase Tale andor TT WaCrecoramends erase HTML, ed sands oneraee for ateter document types he XHTML ‘Lower casei the most common, Lower care f easier to te. ALVI3Schools we alvays use lower ease atribite names We Suggest: Always Quote Attribute Values ‘The KTMLS standard doesnot require quotes around atibute values ‘The href sttribute, demonstrated above, con be written as Example ‘WiC recommends quotes in HTML, and demands quotes for stcter dacumert types Uke XHTML, Sometimesit is necessary to use quotes This wll ot dsclay correctly, because ft contains a space Example Using quotes are the most common, Omitting quotes can prodice eros, [ALYT3Schools we aay use quotes arourd attnbute values, Single or Double Quotes? Double style quotes are the most common in HTML, but single style can also ba used. Jn some stuations, when the attbue value tse contains double quotes, Its necessary to use single quotas Chapter Summary + AIIHTL elements can have attributes + The HTML title meibxte proves adional “tooltip” information ¢ The HTML href atnbute provides addres nfermation forbs 4 The HTML wide and helght atrutes provide size formation for mages 1 The HTML alt atrbute providas text for screen readers * ALSSchools We alvays use lowercase HTM atrfxze names 1 ALBSchools We ays quote ntibutes with dole quotes Test Yourself with Exercises! HTML Attributes Below 1s an alphabetical ist of some arrbutes often used in HTML Attribute Description ae Speaties an altematve text for an mage disabled Specifies that an input element should be disabled rot Species the URL (web address) fora Ene ry Species unique id for an alement se Specifies the URL (web addres) for an image sive Specifies an nine CSS style for an element tite Se) vee Specifies the valve (txt conten) for an input element ‘complete it ofall tuts foreach HTML element is ted in our: HTML Tag Reference « Previous Next Chapter » ionae Mera smpetitors by reaching out eer eens to dients before they da? s before they do? “Top 10 Tutorials Top 10 References Top 10 Examples Web Certificates ito Scere Siecle As carte ameasaitta snes Ramee set Saas (cores ed rome Satine svt cot esamaes eset crete aS una Tre oo i exancer “ever cermate cota tra ry etc Sm am SSRN ar sem Ga ete ce exer Sechools. com

You might also like