Create a Table

<table> </table>

 

Table Rows

The first step in entering data into the table is to add rows using the table row element: <tr>.

 

Table Data

you can add data using the table data element: <td>.

 

In the example above, two data points (73 and 81) were entered in the one row that exists. By adding two data points, we created two cells of data. If the table were displayed in the browser, it would show a table with one row and two columns.

 

 

Table Headings

Table data doesn’t make much sense without titles to describe what the data represents.

To add titles to rows and columns, you can use the table heading element: <th>.

 

Just like table data, a table heading must be placed within a table row.

 

the use of the scope attribute, which can take one of two values:

  1. row - this value makes it clear that the heading is for a row.
  2. col - this value makes it clear that the heading is for a column.

 

Table Borders

So far, the tables you’ve created have been a little difficult to read because they have no borders.

 

The code in the example above is following is  deprecated , so please don’t use it.

CSS에서 해주는게 좋다~~

 

Spanning Columns

What if the table contains data that spans multiple columns?

For example, a personal calendar could have events that span across multiple hours, or even multiple days.

 

Data can span columns using the colspan attribute.

The attributes accepts an integer (greater than or equal to 1) to denote the number of columns it spans across.

질문 2

Spanning Rows

Data can also span multiple rows using the rowspan attribute.

perhaps an event goes on for multiple hours on a certain day

 

 

Table Body

Over time, a table can grow to contain a lot of data and become very long. When this happens, the table can be sectioned off so that it is easier to manage.

 

Long tables can be sectioned off using the table body element: <tbody>.

The <tbody> element should contain all of the table’s data, excluding the table headings (more on this in a later exercise).

 

 

Table Head

When a table’s body is sectioned off, however, it also makes sense to section off the table’s column headings using the <thead> element

 

only the column headings go under the <thead> element.

 

질문 2

 

Table Footer

The bottom part of a long table can also be sectioned off using the <tfoot> element.

 

In the example above, the footer contains the totals of the data in the table.

Footers are often used to contain sums, differences, and other data results.

 

Styling with CSS

 

'2020 > html (codecademy)' 카테고리의 다른 글

HTML Document Standards  (0) 2020.04.10
Introduction to HTML  (0) 2020.04.10

Preparing for HTML

Now that we’ve learned about some of the most common HTML elements,

it’s time to learn how to set up an HTML file.

 

HTML files require certain elements to set up the document properly. We can let web browsers know that we are using HTML by starting our document with a document type declaration.

 

<!DOCTYPE html>

 

This declaration is an instruction, and it must be the first line of code in your HTML document.

To make sure your document is forever interpreted correctly,

always include <!DOCTYPE html> at the very beginning of your HTML documents.

 

2가지 정보를 알려줌

the type of document

the HTML version to expect

 

 

The <html> tag

질문 1

 

 

//

  • Declared to the browser that your code is HTML with <!DOCTYPE html>
  • Added the HTML element (<html>) that will contain the rest of your code.

 

The Head

The <head> element contains the metadata for a web page. Metadata is information about the page that isn’t displayed directly on the web page. Unlike the information inside of the <body> tag, the metadata in the head is information about the page itself. You’ll see an example of this in the next exercise.

 

 

Page Titles

The <title> tag is always inside of the <head>.

 

Linking to Other Web Pages

One of the powerful aspects of HTML (and the Internet), is the ability to link to other web pages.

 

<a>TThis Is A Link To Wikipedia</a>

 

The anchor element in the example above is incomplete without the href attribute. This attribute stands for hyperlink reference and is used to link to a path, or the address to where a file is located (whether it is on your computer or another location). The paths provided to the href attribute are often URLs.

 

 

 

Opening Links in a New Window

웹서핑을 하다가 링크를 클릭하면 페이지가 현재창으로 열리는게 있고 새창으로 열리는게 있음.

target="_blank" 는 새로운 창에서 열리게하는 것

 

 

Linking to Relative Page

When making multi-page static websites,

web developers often store HTML files in the root directory, or a main folder where all the files for the project are stored.

 

we can link web pages together using a relative path.

 

<a href="./contact.html">Contact</a>

 

In this example, the <a> tag is used with a relative path to link from the current HTML file to the contact.html file in the same folder. On the web page, Contact will appear as a link.

A relative path is a filename that shows the path to a local file (a file on the same website, such as ./index.html) versus an absolute path (a full URL, like https://www.codecademy.com/learn/learn-html which is stored in a different folder). The ./ in ./index.html tells the browser to look for the file in the current folder.

 

 

*링크 추가 검색하여 설명* 

인터넷을 하다 보면, 평소에는 화살표 모양이던 마우스 커서가 어떤 그림이나 글 위에 갖다대면 손 모양으로 변함.

그 그림이나 글을 클릭하면 다른 페이지로 이동 가능. (출처: https://blog.hostit.co.kr/144)

-> 이것이 바로 Link 기능! 

 

이렇게 2개의 html을 연결하는 것 외에, 

오른쪽 아래 그림에서 '여기'를 클릭하면 여러 정보가 보일것.

Then, 그 정보 사이트에서 다시 저 오른쪽 아래 그림으로 오려면??? (이게 바로 html -> index.html)

 

 

Linking At Will

You’ve probably visited websites where not all links were made up of text.

Maybe the links you clicked on were images or some other form of content.

 

it’s possible to turn images into links by simply wrapping the <img> element with an <a> element.

 

저 곰을 누르면 위키로 이동

 

Linking to Same Page

https://www.youtube.com/watch?v=igDwtfqyWEc

 

강의도 보자~ 

 

질문 1

 

Whitespace

Programmers use two tools to visualize the relationship between elements: whitespace and indentation.

 

 

Indentation

들여쓰기

 

At the time of writing, the W3C recommends 2 spaces of indentation when writing HTML code.

Although your code will work without exactly two spaces, this standard is followed by the majority of professional web developers.

 

Comments

HTML files also allow you to add comments to your code.

 

Comments begin with <!-- and end with -->. 

 

 

'2020 > html (codecademy)' 카테고리의 다른 글

Tables  (0) 2020.04.12
Introduction to HTML  (0) 2020.04.10

 

HTML is the skeleton of all web pages.

HTML provides structure to the content appearing on a website, such as images, text, or videos.

In HTML, the computer can interpret raw text that is wrapped in HTML elements.

Learning HTML is the first step in creating websites.

 

ㅡ HyperText = hyperlinks

 

 

HTML is composed of elements. These elements structure the webpage and define its content. 

 

예를 들어서, paragrah element 구조는 다음과 같음

<p>content</p>

 

  • An opening tag (<p>)

  • The content (“Hello World!” text)

  • A closing tag (</p>)

*tag를 element라고 같다고 보면 안됨* 

HTML Element = tag + content 

                    = a unit of content in an HTML document formed by HTML tags and the text or media it contains.

 

HTML Tag = the element name, surrounded by an opening (<) and closing (>) angle bracket.

 

 

The Body

 

 

HTML Structure

HTML is organized as a collection of family tree relationships. As you saw in the last exercise, we placed <p> tags within <body> tags. When an element is contained inside another element, it is considered the child of that element. The child element is said to be nested inside of the parent element.

자식 얘기가 전세계 오피셜한 얘기였구낭...

 

Since there can be multiple levels of nesting, this analogy can be extended to grandchildren, great-grandchildren, and beyond. The relationship between elements and their ancestor and descendent elements is known as hierarchy.

 

Understanding HTML hierarchy is important because child elements can inherit behavior and styling from their parent element. You’ll learn more about webpage hierarchy when you start digging into CSS.

 

 

Headings

In HTML, there are six different headings, or heading elements.

 

  1. <h1> — used for main headings. All other smaller headings are used for subheadings.
  2. <h2>
  3. <h3>
  4. <h4>
  5. <h5>
  6. <h6>

 

 

Divs

One of the most popular elements in HTML is the <div> element. 

 

<div> is short for “division” or a container that divides the page into sections. These sections are very useful for grouping elements in your HTML together.

 

Remember to always add two spaces of indentation when you nest elements inside of <div>s for better readability.

 

 

Attributes

If we want to expand an element’s tag, we can do so using an attribute. Attributes are content added to the opening tag of an element and can be used in several different ways, from providing information to changing styling. Attributes are made up of the following two parts:

  • The name of the attribute
  • The value of the attribute

One commonly used attribute is the id. We can use the id attribute to specify different content (such as <div>s) and is really helpful when you use an element more than once. ids have several different purposes in HTML, but for now, we’ll focus on how they can help us identify content on our page.

When we add an id to a <div>, we place it in the opening tag:

 

가독성을 위해 써주는듯?

 

Displaying Text

If you want to display text in HTML, you can use a paragraph or span:

 

  • Paragraphs (<p>) contain a block of plain text.
  • <span> contains short pieces of text or other HTML. They are used to separate small pieces of content that are on the same line as other content.

It’s best to use a <span> element when you want to target a specific piece of content that is inline, or on the same line as other text. If you want to divide your content into blocks, it’s better to use a <div>.

 

 

Styling Text

You can also style text using HTML tags.

 

  • The <em> tag will generally render as italic emphasis.
  • The <strong> will generally render as bold emphasis.

 

Line Breaks

The spacing between code in an HTML file doesn’t affect the positioning of elements in the browser.

If you are interested in modifying the spacing in the browser, you can use HTML’s line break element: <br>.

웹사이트에서 보이는 문장에서, 엔터 기능이 이거구낭

 

질문글 1 

 

Unordered Lists

In HTML, you can use an unordered list tag (<ul>) to create a list of items in no particular order.

An unordered list outlines individual list items with a bullet point.

 

 

Ordered Lists

Ordered lists (<ol>) are like unordered lists, except that each list item is numbered. 

They are useful when you need to list different steps in a process or rank items for first to last.

 

 

 

Images

Most elements require both opening and closing tags, but the <img> tag is a self-closing tag.

Note that the end of the <img> tag has a forward slash /. 

 

The <img> tag has a required attribute called src.

The src attribute must be set to the image’s source, or the location of the image. 

 

 

Image Alts

Part of being an exceptional web developer is making your site accessible to users of all backgrounds.

 

The alt attribute, which means alternative text, brings meaning to the images on our sites.

The alt attribute can be added to the image tag just like the src attribute. The value of alt should be a description of the image.

 

If the image on the web page is not one that conveys any meaningful information to a user (visually impaired or otherwise), the alt attribute should be left empty.

꼭 있다고 좋은건 아닌가보다.

 

 

Videos

Unlike the <img> tag however, the <video> element requires an opening and a closing tag.

In this example, the video source (src) is myVideo.mp4 

The source can be a video file that is hosted alongside your webpage, or a URL that points to a video file hosted on another webpage.

 

After the src attribute, the width and height attributes are used to set the size of the video displayed in the browser.

 

The controls attribute instructs the browser to include basic video controls: pause, play and skip.

 

The text, “Video not supported”, between the opening and closing video tags will only be displayed if the browser is unable to load the video.

 

'2020 > html (codecademy)' 카테고리의 다른 글

Tables  (0) 2020.04.12
HTML Document Standards  (0) 2020.04.10

+ Recent posts