Ramme med HTML - hvordan det fungerer
For at gøre medierne på dit websted mere tiltalende kan du bruge HTML-kode til at tegne en ramme omkring det. I dette praktiske tip viser vi dig, hvordan dette fungerer, og hvilke fordele cascading styleheets (CSS) tilbyder, når du definerer en ramme.
HTML-kodning - tegne rammer omkring billeder og andre medier
Som standard har hvert billede en ramme, der er en pixel bred. Dette er dog kun synligt, hvis billedet bruges som et hyperlink. Med attributten "border" kan du individuelt definere tykkelsen på rammen.
- I HTML ser koden for en sort ramme på ti pixel sådan ud:
- Denne ramme påføres alle fire sider af objektet.
- Alternativt kan du bruge et billedredigeringsprogram som Gimp til at tegne rammen omkring dit billede.
- Bemærk dog, at dette vil gøre billedet større, og det vil tage længere tid, før besøgende på dit websted downloader billedet.
Definer rammen i HTML-dokumentet med CSS
Du kan definere rammen - for eksempel en boks omkring en tekst - med cascaderende stilark endnu mere præcist.
- Et andet praktisk tip fortæller dig, hvordan du integrerer en CSS-fil på dit websted.
- I dette CSS-dokument kan du indstille farven og tykkelsen på rammen forskelligt for alle fire sider:
- border-bottom: # 999 - Indstiller farven for bundrammen. Her kan du også bruge "border-top", "border-right" eller "border-left".
- kantbredde: 0 0 tynd tynd - Angiver linjetykkelse. Dette gøres med uret. Her betyder det, at der ikke kan ses linjer øverst og højre, medens der er defineret en tynd linje nederst og til venstre.
- kantstil: ingen ingen rille rille - Definerer den dekorative ramme til dit billede eller din kasse. "Groove" -stil skaber en 3D-effekt.
Din startside lever naturligvis fra dens tilstedeværelse på nettet. I den næste artikel læser du de bedste tip til forbedring af din Google-placering.