首頁 web前端 css教學 日 - HTML 和 CSS

日 - HTML 和 CSS

Jan 03, 2025 pm 08:54 PM

HTML:
HTML 代表超文本標記語言。
HTML 是用於建立網頁的標準語言。
它使用標籤或元素系統定義網頁的結構。

CSS:

CSS 代表層疊樣式表。
它用於設定 HTML 建立的網頁佈局的樣式和格式。
它控制顏色、字體、間距、定位和響應式設計等內容。
CSS 可讓您將結構(HTML)與設計(樣式)分開,使網站更易於維護且更靈活。

JS:
Js 代表 JavaScript。
它是一種程式語言,用於在網頁瀏覽器中創建動態和互動效果。
HTML 建立頁面並使用 CSS 設計樣式,而 JavaScript 可以與頁面互動並動態修改內容。

HTML:
HTML 是基於文字的語言,它定義了網頁內容的結構和意義。

Day -HTML ans CSS

獨立標籤:
在 HTML 中,獨立標籤是指不需要結束標籤的 HTML 元素。這些通常也稱為自關閉標籤或空元素。

範例:

<br>
<hr>
<input>
登入後複製

結構標籤:
標籤通常成對出現:開始標籤和結束標籤。

範例:

<html>
<head>
<body>
登入後複製

元素:
元素是網頁的建構塊,代表文件中各種類型的內容和結構。

HTML 元素的組成:

Opening Tag: The starting part of the element that defines the type of content that follows.
    Example:<p>, <h1>, <div>, <img>

Content: The content placed between the opening and closing tags (if applicable). This could be text, images, links, or other elements.
    Example: This is a paragraph.

Closing Tag: The closing part of the element that indicates the end of the element. It is the same as the opening tag, but with a forward slash (/) before the tag name.
   Example: </p>, </h1>, </div>

Attributes (Optional): Additional properties that provide extra information about the element. Attributes are added inside the opening tag.
    Example:>
<p><strong>Example:</strong><br>
</p>

<pre class="brush:php;toolbar:false"><html>
<head>
    <title>ILUGC</title>
<style>
.container{
    border:1px solid;
    height:200%;
    width:85%;
    margin:auto;
}
.header h4{
    text-transform: uppercase;
    color:#e22d30;
    border-top:1px solid green;
    width: fit-content;
    padding-top:10px;
}
.header{

    margin:25px;
}
</style>
</head>
<body>
   <div>



<p><strong>Explanation of the HTML Structure:</strong><br>
</p>

<pre class="brush:php;toolbar:false"><html>: Root element of the HTML document.
        <head>: Contains metadata for the page, including the title and styles.
        <body>:Contains the content visible on the page.

    Inside the <head>:
        The <title> tag gives the webpage its title when viewed in the browser tab.
        The <style> tag contains the internal CSS to style the page.

    Inside the <body>:

        .container:A container div with a class container that holds all the page elements.
            It's styled with a border, height, width, and centered using margin:auto.

        .header: A section that contains the main title (<h1>) and a subtitle (<h4>) about the ILUGC group.
            The h4 tag is styled with uppercase letters, a red color, a border on top, and some padding.

        navbar: This seems to be a placeholder for a navigation bar.

        layout: A section for the main content layout, with two subsections:
            mainLayout: Likely for the main content area.
            sideLayout: Likely for a sidebar or additional content.

        footer: Placeholder for the footer section.

登入後複製

div:
該元素是一個區塊級容器,用於將其他元素分組在一起並向它們套用樣式或佈局屬性。

類別選擇器:

類別選擇器用於選擇具有特定類別屬性的元素並為其設定樣式。它是 CSS 中最常用的選擇器之一。類別選擇器由點 (.) 後面跟著類別名稱定義。

文法:

.classname {

}
登入後複製

元素選擇器:

元素選擇器(也稱為類型選擇器)用於根據標籤名稱選擇 HTML 元素並設定其樣式。它允許您將樣式套用至文件中特定類型 HTML 元素的所有實例。

文法:

element {

}
登入後複製

邊距:

CSS 中的 margin 屬性用於在元素外部建立空間。

文法:

element {
  margin: value;
}
登入後複製

填充:

CSS 中的 padding 屬性用於在元素內部、內容和邊框之間建立空間。

文法:

element {
  padding: value;
}
登入後複製

以上是日 - HTML 和 CSS的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1321
25
PHP教程
1269
29
C# 教程
1249
24
使Sass更快的概念證明 使Sass更快的概念證明 Apr 16, 2025 am 10:38 AM

在一個新項目開始時,Sass彙編發生在眼睛的眨眼中。感覺很棒,尤其是當它與browsersync配對時,它重新加載

靜態表單提供商的比較 靜態表單提供商的比較 Apr 16, 2025 am 11:20 AM

讓我們嘗試在這裡造成一個術語:“靜態表單提供商”。你帶上html

每周平台新聞:HTML加載屬性,主要的ARIA規格以及從iframe轉移到Shadow dom 每周平台新聞:HTML加載屬性,主要的ARIA規格以及從iframe轉移到Shadow dom Apr 17, 2025 am 10:55 AM

在本週的平台新聞綜述中,Chrome引入了一個用於加載的新屬性,Web開發人員的可訪問性規範以及BBC Move

與部分元素的交易 與部分元素的交易 Apr 12, 2025 am 11:39 AM

同一天發表了兩篇文章:

多腳步滑塊:一般案例 多腳步滑塊:一般案例 Apr 12, 2025 am 10:52 AM

這個兩部分系列的第一部分詳細介紹了我們如何獲得兩次跑步的滑塊。現在,我們&#039;

帶有HTML對話框元素的一些動手 帶有HTML對話框元素的一些動手 Apr 16, 2025 am 11:33 AM

這是我第一次查看HTML元素。我已經意識到了一段時間,但是尚未將其旋轉。它很酷,

我們如何標記Google字體並創建Goofonts.com 我們如何標記Google字體並創建Goofonts.com Apr 12, 2025 pm 12:02 PM

Goofonts是由開發人員和設計師丈夫簽名的附帶項目,它們都是版式的忠實擁護者。我們一直在標記Google

它全部都在頭上:管理帶有React頭盔的React Power Site的文檔頭 它全部都在頭上:管理帶有React頭盔的React Power Site的文檔頭 Apr 15, 2025 am 11:01 AM

該文檔負責人可能不是網站上最迷人的部分,但是其中所處的內容對於您的網站的成功也一樣重要

See all articles