Rám s HTML - ako to funguje
Ak chcete, aby médiá na vašom webe boli príťažlivejšie, môžete pomocou kódu HTML nakresliť okolo neho rám. V tomto praktickom tipe vám ukážeme, ako to funguje a aké výhody ponúka kaskádové štýly (CSS) pri definovaní rámca.
HTML kódovanie - nakreslite rámy okolo obrázkov a iných médií
V predvolenom nastavení má každý obrázok rámec, ktorý je široký jeden pixel. Toto je viditeľné iba v prípade, že sa obrázok používa ako hypertextový odkaz. Pomocou atribútu "ohraničenie" môžete individuálne definovať hrúbku rámu.
- V HTML vyzerá kód pre čierny rámik s desiatimi pixelmi takto:
- Tento rámec sa aplikuje na všetky štyri strany objektu.
- Prípadne môžete na úpravu rámčeka okolo obrázka použiť program na úpravu obrázkov, napríklad Gimp.
- Upozorňujeme však, že sa tým obrázok zväčší a bude trvať dlhšie, kým si ho návštevník vášho webu stiahne.
Definujte rámec v dokumente HTML pomocou CSS
Rámec - napríklad rámček okolo textu - môžete definovať pomocou kaskádových štýlov ešte presnejšie.
- Ďalší praktický tip vám povie, ako integrovať súbor CSS do svojich webových stránok.
- V tomto dokumente CSS môžete nastaviť farbu a hrúbku rámu odlišne pre všetky štyri strany:
- border-bottom: # 999 - Nastaví farbu dolného rámu. Tu môžete tiež použiť „okraj-hore“, „okraj-doprava“ alebo „okraj-doľava“.
- šírka okraja: 0 0 tenká tenká - určuje hrúbku čiary. To sa deje v smere hodinových ručičiek. To znamená, že na hornom a pravom okraji nie sú viditeľné žiadne čiary, zatiaľ čo na spodnej a ľavej strane je definovaná tenká čiara.
- border-style: none none groove groove - Definuje dekoratívny rám pre váš obrázok alebo rámček. Štýl „drážky“ vytvára 3D efekt.
Vaša domovská stránka prirodzene žije z jej prítomnosti na sieti. V nasledujúcom článku si prečítate najlepšie tipy na zlepšenie hodnotenia Google.