Havolalar va tegi
The web is built on the idea of hypertext.Hypertext means that you can have textual documents,like web pages, but that they also have references beetween them.
On the web, those are links.
Every time you click on a link in a web page, you're making use of hypertext.
When you write HTML,you can link to other web pages,both your own and also someone else's.
That's how a search engine works,for example.
So, here's how to make a link in your own HTML.
The element for making links is called .
Yes, it's not called link, it's called .
That stands for anchor, because an element anchors an address to a piece of text on the page.
Yeah, that sounds weird to me too, but that's how it is , at least it's short.
But we can't just use by itself.
There are a couple things we need an element to include in order to make a link.
The text that a user clicks on to follow the link, and the URL of the page we're linking to.
Here's how we're going to do that.
The opening tag for the elements has this extra little bit in it that we haven't seen in HTML tags before.
This href equals "a url" part.
This is an example of an HTML attribute.
It's an extra piece of data that comes along with the element and it gives it extra meaning.
The part before the equal sign is the name of the attribute, and the part after, in double quotes, is the value of the attribute.
Here, the name is href and the value is http://example.net.
The name href stands for hypertext reference, and it's used with tags and a few other tags that link to another document.
You won't ever see it on a paragraph or an emphasis tag or something else.
Then, there's the contents of the element, which becomes the text that appears on the page. Then there's the closing tag. You might notice that it doesn't have any attributes in it.
Attributes like href always only go in the opening tag at the beginning of an element. That's pretty much all there is to making links in HTML. You've just made an element with a start and an end tag. The start tag has an href attribute with an equal sign, and in double-quotes, the url of the page that we want to link to. The contents of the element become the text the user clicks on, and then there's a closing tag.
Internet gipermatn g'oyasi asosida qurilgan bo'lib, gipermatn veb-sahifalar kabi matnli hujjatlarga ega bo'lishingizni, ammo ular orasida mos yozuvlar mavjudligini anglatadi.
Internetda bu havolalar.
Har safar veb-sahifadagi havolani bosganingizda gipermatndan foydalanasiz.
HTML-ni yozishda siz o'zingizning ham, boshqalarning ham boshqa veb-sahifalariga bog'lanishingiz mumkin.
Masalan, qidiruv tizimi shunday ishlaydi.
Shunday qilib, o'zingizning HTML-da qanday qilib havolani o'rnatish kerak.
Havolalarni o'rnatish uchun element deb nomlanadi.
Ha, bu havola emas, balki deb nomlanadi.
Bu langar degan ma'noni anglatadi, chunki elementi sahifadagi matn qismiga manzilni o'rnatadi.
Ha, bu menga ham g'alati tuyuladi, lekin shunday, hech bo'lmaganda qisqa.
Ammo biz faqat dan o'zimiz foydalana olmaymiz.
Bizga havolani o'rnatish uchun bir nechta narsalar kerak bo'ladi.
Foydalanuvchi havolani bosish uchun bosgan matn va biz bog'laydigan sahifaning URL manzili.
Mana buni qanday amalga oshiramiz.
elementlari uchun ochiladigan yorliqda biz bundan oldin HTML teglarida ko'rmagan qo'shimcha narsalar mavjud.
Ushbu href "url" qismiga teng.
Bu HTML atributining misoli.
Bu element bilan birga keladigan qo'shimcha ma'lumotlar va bu ularga qo'shimcha ma'no beradi.
Teng belgidan oldingi qism atributning nomi, ikkilangan tirnoqlarda esa atributning qiymati.
Bu erda ism href va qiymati http://example.net.
Href nomi gipermatnli ma'lumotni anglatadi va u teglari va boshqa hujjat bilan bog'langan bir nechta teglar bilan ishlatiladi.
Siz buni hech qachon xatboshida yoki ta'kid yorlig'ida yoki boshqa biron bir narsada ko'rmaysiz.
Keyin sahifada paydo bo'ladigan matnga aylanadigan elementining tarkibi mavjud. Keyin yopiladigan yorlig'i mavjud. Unda hech qanday atribut yo'qligini sezishingiz mumkin.
Href kabi atributlar har doim faqat elementning boshida ochilish yorlig'ida bo'ladi. Bu HTML-da havolalar o'rnatish uchun deyarli hamma narsa. Siz boshi va oxiri yorlig'i bo'lgan elementini yaratdingiz. Boshlash tegida href atributi teng belgiga ega va ikkita tirnoqlarda biz bog'lashni istagan sahifaning url-si mavjud. Elementning tarkibi foydalanuvchi bosgan matnga aylanadi, so'ngra yopiladigan yorlig'i bo'ladi.
Do'stlaringiz bilan baham: |