Return to Video

HTML Basics (Video Version)

  • 0:00 - 0:02
    Բարի գալուստ մեր կայքէջ
  • 0:02 - 0:04
    Գիտեմ որ սա անյնքան էլ գրավիչ կայքէջ չէ
  • 0:04 - 0:07
    Այն ամբողջովին դատարկա է, բայց ամեն կայքէջ այդպես է սկսվում

  • 0:07 - 0:10
    և ես Ձեզ շուտով ցույց կտամ, թե ինչպես կարելի է կառուցել էջ
  • 0:10 - 0:12
    Բայց առաջին հերթին եկեք
  • 0:12 - 0:15
    ուսումնասիրենք դատարկ էջի կմախքը
  • 0:15 - 0:17
    Ամեն կայքէջ սկսվում է
  • 0:17 - 0:20
    այս, վերևում երևացող տողը, DOCTYPE-ը
  • 0:21 - 0:22
    տեղեկացնում է զննիչին, որ
  • 0:22 - 0:25
    այս կայքէջը գրված է ժամանակակից HTML-ով
  • 0:25 - 0:28
    այլ ոչ hին ու տաօրինակ HTML-ով
  • 0:28 - 0:31
    Հիմա նայենք էջի առաջին թեգին
  • 0:31 - 0:35
    HTML is markup language,
    so it's all about tags.
  • 0:35 - 0:36
    A tag is one of these things
  • 0:36 - 0:38
    that starts with an angle bracket
  • 0:38 - 0:41
    and ends with another angle bracket.
  • 0:41 - 0:42
    Or if you like math,
    you might think of them
  • 0:42 - 0:45
    as less than and greater than signs.
  • 0:46 - 0:48
    The first tag of every page is always
  • 0:48 - 0:51
    that HTML tag right under the DOCTYPE.
  • 0:51 - 0:54
    This one is the start HTML tag,
  • 0:54 - 0:57
    and then at the bottom,
    there's this end HTML tag,
  • 0:57 - 1:00
    which is the same except
    for this backslash,
  • 1:00 - 1:02
    which is really important.
  • 1:02 - 1:05
    The HTML tag needs to
    contain every other tag
  • 1:05 - 1:07
    that makes up this webpage.
  • 1:07 - 1:11
    That's why we don't have the
    end HTML tag until the bottom.
  • 1:11 - 1:13
    A lot of HTML tags come
    in pairs like this,
  • 1:13 - 1:15
    but not all of them.
  • 1:16 - 1:19
    Underneath HTML, there's
    always a head tag.
  • 1:19 - 1:22
    That contains tags that helps
    the browser render the page,
  • 1:22 - 1:25
    but doesn't contain anything
    the user actually sees.
  • 1:25 - 1:28
    There's this meta tag
    that gives the browser
  • 1:28 - 1:30
    more details about how to render the page.
  • 1:30 - 1:32
    For example, if you're
    using common characters
  • 1:32 - 1:33
    like from English language
  • 1:33 - 1:35
    and not harder to render characters
  • 1:35 - 1:37
    from the Arabic language,
  • 1:37 - 1:40
    then you should have meta
    charset equals utf-8.
  • 1:40 - 1:42
    Then there's this title tag,
  • 1:42 - 1:45
    which the browser uses to
    decide the title of the page.
  • 1:45 - 1:48
    This is what shows in the
    tab on top of browsers
  • 1:48 - 1:50
    and in bookmarks and in search results.
  • 1:50 - 1:53
    Here on Khan Academy, the title
    shows up above our webpage.
  • 1:54 - 1:56
    Let me change the title.
  • 1:56 - 1:59
    I'm going to make a
    page all about rabbits.
  • 1:59 - 2:02
    So I'll say "All About Rabbits"
  • 2:02 - 2:05
    and maybe you can actually
    see as it changes above.
  • 2:06 - 2:08
    Nice, now we're done with these details
  • 2:08 - 2:12
    so we end the head tag
    and move on to the tag
  • 2:12 - 2:15
    where it's all going to
    happen, the body tag.
  • 2:15 - 2:18
    It's pretty boring right now,
    just the start and the end.
  • 2:18 - 2:20
    What should I add?
  • 2:20 - 2:22
    Well, I'm making a webpage about rabbits,
  • 2:22 - 2:23
    so I should probably declare
  • 2:23 - 2:25
    that in a big ole headline at the top.
  • 2:26 - 2:29
    To add a headline, we use the H1 tag.
  • 2:30 - 2:33
    All about rabbits, great.
  • 2:33 - 2:35
    Actually we have six
    tags that we could use
  • 2:35 - 2:38
    for headlines: H1, H2, H3, H4, H5 and H6.
  • 2:38 - 2:41
    The H1 is for the most
    important headlines on the page
  • 2:41 - 2:43
    and H6 is the least important.
  • 2:43 - 2:46
    Let me add a few more
    headlines for other sections.
  • 2:46 - 2:49
    I'll use an H2 since these are slightly
  • 2:49 - 2:51
    less important sections.
  • 2:52 - 2:55
    And some songs, ok, great.
  • 2:56 - 2:58
    Now let's add some information.
  • 2:58 - 3:00
    Well, my target audience for this page
  • 3:00 - 3:04
    is aliens that have never seen rabbits.
  • 3:04 - 3:07
    So I better give them a
    good description of rabbits.
  • 3:07 - 3:10
    In fact, I think I need a
    whole paragraph of information.
  • 3:10 - 3:13
    How can I markup a paragraph in HTML?
  • 3:13 - 3:16
    With the P tag of course.
  • 3:16 - 3:21
    We put in that P tag, and then
    I'm just going to go ahead
  • 3:21 - 3:23
    and paste in the information
  • 3:23 - 3:26
    so that you don't have to
    watch me type the whole thing.
  • 3:26 - 3:27
    Beautiful.
  • 3:28 - 3:31
    Now the aliens will need a
    song to greet the rabbits with,
  • 3:31 - 3:33
    so I'll give them lyrics
    to my personal favorite.
  • 3:33 - 3:38
    Once again, use that P tag
    for it and paste in the song
  • 3:40 - 3:43
    "Little Bunny Foofoo", such a good song.
  • 3:44 - 3:48
    But uh oh, it's showing
    up all on the same line.
  • 3:48 - 3:50
    How will the aliens know when to pause?
  • 3:50 - 3:52
    Why didn't the browser render
  • 3:52 - 3:54
    the line breaks that I put in here?
  • 3:54 - 3:57
    Well actually, browsers
    mostly ignore line breaks
  • 3:57 - 3:59
    and white space in your HTML.
  • 3:59 - 4:02
    If we want the browser
    to render a line break,
  • 4:02 - 4:05
    we have to tell it
    explicitly using another tag,
  • 4:05 - 4:08
    the BR tag, which stands for break.
  • 4:08 - 4:13
    We'll go through and
    add BRs after each line.
  • 4:13 - 4:15
    Now it looks like lyrics.
  • 4:15 - 4:19
    Do you notice something funny about BR?
  • 4:19 - 4:21
    There's no end tag.
  • 4:21 - 4:22
    If you think about it,
  • 4:22 - 4:23
    a line break doesn't contain any content,
  • 4:23 - 4:26
    so it has nothing to end after.
  • 4:26 - 4:28
    Just the start tag is all we need.
  • 4:29 - 4:30
    There we have it.
  • 4:30 - 4:33
    The aliens will learn
    the basics of rabbits
  • 4:33 - 4:36
    and you've learned the basics of HTML.
  • 4:36 - 4:37
    After I'm done talking,
  • 4:37 - 4:40
    play around with this
    and try changing things.
  • 4:40 - 4:44
    When you're ready, go on to
    your first HTML challenge.
Title:
HTML Basics (Video Version)
Description:

{'type': u'plain'}

more » « less
Video Language:
English
Duration:
04:44

English subtitles

Revisions