Babban matsalar da ke da alaฦa da canza hotunan bango a cikin HTML shine cewa yana iya zama da wahala a tabbatar da cewa hoton yana nunawa daidai a cikin duk masu bincike da na'urori. Bugu da ฦari, idan hoton ya yi girma ko ฦanฦanta, zai iya haifar da matsala tare da saurin lodawa da aiki. A ฦarshe, akwai hanyoyi daban-daban don saita hoton baya a cikin HTML (misali, ta amfani da CSS ko salo na layi), don haka tabbatar da cewa an yi amfani da madaidaiciyar hanya don wani yanayi na iya zama da wahala.
<body style="background-image:url('image.jpg');"> </body>
1. Wannan layin code yana haifar da sinadarin jiki na HTML.
2. Hakanan yana saita hoton bangon jikin jikin zuwa hoton da yake a "image.jpg".
Hotuna bayanan
Ana iya amfani da hotunan bangon baya a cikin HTML don ฦara sha'awar gani zuwa shafin yanar gizon. Ana iya amfani da su azaman kayan ado, ko kuma ana iya amfani da su don isar da bayanai. Ana ฦara hotunan bangon baya ta amfani da kayan hoton baya a cikin CSS. Wannan kadarar tana ba ku damar saka fayil ษin hoto, kamar JPEG ko PNG, wanda za'a nuna a bayan wasu abubuwa akan shafin. Har ila yau, dukiya ta hoton baya tana ba ku damar saita wasu kaddarorin irin su maimaita-bayani da matsayi na baya waษanda ke sarrafa yadda ake nuna hoton akan shafin.
Ta yaya zan canza hoton bango a HTML
Canza hoton bango a cikin HTML tsari ne mai sauฦi. Don yin wannan, kuna buฦatar amfani da bayanan bayanan-hoton a cikin CSS.
Da farko, kuna buฦatar ayyana hoton da kuke son amfani da shi azaman asalin ku. Kuna iya yin haka ta amfani da cikakkiyar URL ko dangi don fayil ษin hoton. Misali:
Na gaba, ฦara lambar da ke gaba zuwa takaddar HTML ษin ku:
Wannan zai saita ฦayyadadden hoton azaman hoton bangon shafinku. Hakanan zaka iya daidaita wasu kaddarorin kamar matsayi da maimaita ta amfani da ฦarin dokokin CSS idan an buฦata.