>  기사  >  웹 프론트엔드  >  HTML 명령

HTML 명령

王林
王林원래의
2024-09-04 16:13:50740검색

HTML은 웹페이지의 표준 마크업 언어인 하이퍼 텍스트 마크업 언어를 의미합니다. HTML에는 요소, 속성 및 기타 태그가 있습니다. 인터넷에 존재하는 대부분의 웹사이트는 HTML을 사용합니다. HTML은 배우기 쉽고 강력합니다. 하이퍼텍스트는 다른 페이지로 리디렉션되는 하이퍼링크를 클릭하여 웹을 이동하는 주요 방법입니다. 마크업은 테스트를 특정 유형으로 표시하여 HTML 태그를 사용하여 그 안에 텍스트를 표시합니다. HTML 명령 요소는 HTML 페이지의 구성 요소이며 요소에 대한 추가 정보를 제공하는 속성을 가질 수 있으며 속성은 쌍으로 제공됩니다.

기본 HTML 명령

기본 명령어는 다음과 같습니다.

1. 샘플 HTML 문서 구문

샘플 HTML 문서에는 웹페이지의 구성 블록인 HTML 요소가 있으며 일부 HTML 요소는 루트 요소인 , 메타 정보,

여기에는 문서 제목과 문서의 데이터가 포함되어 있습니다.

코드:

html>

<meta>
<title>Page Title</title>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

출력:

HTML 명령

2. HTML 제목

HTML 제목은

태그로 정의된 HTML 요소입니다.

여기서

가장 중요한 태그를 정의하고

덜 중요한 태그를 정의합니다.

아래 제목이 포함된 샘플 HTML 코드:

<h1> This is heading 1 </h1>
<h2> This is heading 2 </h2>
<h3> This is heading 3 </h3>
<h4> This is heading 4 </h4>

출력:

HTML 명령

3. HTML 요소 단락

HTML 단락은

태그이며, 샘플 코드는 다음과 같습니다.

<p> This is a paragraph </p>
<p> This is another paragraph </p>

출력:

HTML 명령

4. HTML 이미지

HTML 이미지는 HTML 명령 태그로 정의된 HTML 요소이며, 이미지의 src, alt는 표시할 이미지의 대체 텍스트, 너비, 높이를 의미하며 샘플 코드는 다음과 같은 속성을 언급해야 합니다.

코드:

<img src="HTML%20%EB%AA%85%EB%A0%B9.jpg" alt="HTML 명령"   style="max-width:90%">

출력:

HTML 명령

5. HTML 목록

HTML 목록은 HTML 요소이며

    태그를 사용하여 정의됩니다. 또는
    여기서
    는 순서가 없는 목록이고
    주문된 목록입니다

    코드:

    
    
  • Coffee
  • Tea
  • Milk

출력:

HTML 명령

6. 테이블 생성

HTML 테이블은 HTML 요소이며

태그를 사용하여 정의할 수 있습니다. 태그 태그
그리고 아래와 같이 코드를 작성하세요:

코드:


Firstname Lastname Age
Jill Smith 50

출력:

HTML 명령

7. 링크 언급

HTML 링크는 HTML 요소이며 태그를 사용하여 정의할 수 있습니다. 샘플 코드는 다음과 같습니다.

코드:

<a href="https://www.HTML%20%EB%AA%85%EB%A0%B9.com">This is a link </a>

출력:

HTML 명령

8. 스타일 속성

HTML 속성 스타일은

와 같은 HTML 요소의 조합과 함께 사용할 수 있으며, 샘플 코드는 다음과 같습니다.

코드:

<p style="color:red"> I am a paragraph </p>

출력:

HTML 명령

9. 언어 속성

HTML에서는 lang 속성을 사용하여 태그이며, 언어는 lang 속성을 이용하여 정의하며, 샘플코드는 아래와 같습니다.

코드:



...
...

출력:

HTML 명령

10. HTML 요소 형식 지정

HTML에서는 서식 지정 요소를 사용하여 HTML 문서의 서식을 지정할 수 있으며 특별한 의미를 지닌 텍스트에 대한 특수 요소를 정의할 수 있습니다. 굵게 표시하려면 이탤릭체

코드:

<b> This text is bold. </b>

출력:

HTML 명령

중급 HTML 명령

중간 명령은 다음과 같습니다.

1. 텍스트 강조

HTML에서는 요소를 사용하여 HTML 문서의 일부 텍스트를 강조 표시할 수 있습니다. 안에 있는 텍스트를 강조 표시합니다. 요소이며, 샘플 코드는 아래와 같습니다.


<h2> html <mark> Marked </mark> formtting </h2>

출력:

HTML 명령

2. Delete text

In HTML, we can delete some text using element so that the text which is enclosed between this element is deleted, and the sample code is as below:


<p> My favorite color is <del> Navy blue </del> Red </p>

Output:

HTML 명령

3. Define superscripted text

In HTML, we can define the text as superscripted using element in the HTML document so that text enclosed in element will be superscripted, and the sample code is as below:


<p> This is <sup> superscripted </sup> text </p>

Output:

HTML 명령

4. Define abbreviation

In HTML, we can define abbreviations by using the HTML element in the HTML document, which will give useful information to browsers, and the sample code is as below:


<p> The <abbr title="World Health Organization">WHO </abbr> was founded in 1948 </p>

Output:

HTML 명령

5. Mention Address

In HTML, we can mention the address in an HTML document using HTML element

, which defines contact information or address related to the article or document and displays in italics and the sample code as below:

<address>
Written by Srinivas <br>
dasu.com <br>
Pincode : 500084, Hyderabad <br>
India
</address>

Output:

HTML 명령

Advanced HTML Commands

The advanced commands are as follows:

1. Display a webpage inside a webpage

In HTML, we can display a webpage inside a webpage using HTML iframe, which is defined using the tag


<iframe src="demo.html" height="300" width="300"> </iframe>

2. Target different targets using iframe

In HTML, we can use the target frame as a link using the iframe tag in the HTML document, and the target attribute to the link must refer to the name attribute of the iframe and sample code is as below:


<iframe src="demo.html" name="iframe1"> </iframe>
<p> <a href="www.google.com" target="iframe1"> Google.co.in </a> </p>

Tips and Tricks to Use HTML Commands

  • Make your visitors change the text color or background by adding extra code.
  • Add metadata while writing an HTML document.
  • It’s good to hide some fields where we don’t want a user to edit them.
  • Always add a horizontal line to break long sections so the website will look good.

Conclusion

Finally, it’s all about different types of HTML commands of various levels are briefly discussed with examples. After reading this article, I hope you will have a good idea of how to use HTML commands.

위 내용은 HTML 명령의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:HTML의 기호다음 기사:HTML의 기호