首页 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

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++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 教程
1317
25
PHP教程
1268
29
C# 教程
1246
24
如何使用HTML,CSS和JavaScript创建动画倒计时计时器 如何使用HTML,CSS和JavaScript创建动画倒计时计时器 Apr 11, 2025 am 11:29 AM

您是否曾经在项目上需要一个倒计时计时器?对于这样的东西,可以自然访问插件,但实际上更多

HTML数据属性指南 HTML数据属性指南 Apr 11, 2025 am 11:50 AM

您想了解的有关HTML,CSS和JavaScript中数据属性的所有信息。

使Sass更快的概念证明 使Sass更快的概念证明 Apr 16, 2025 am 10:38 AM

在一个新项目开始时,Sass汇编发生在眼睛的眨眼中。感觉很棒,尤其是当它与browsersync配对时,它重新加载

当您看上去时,CSS梯度变得更好 当您看上去时,CSS梯度变得更好 Apr 11, 2025 am 09:16 AM

我关注的一件事是Lea Verou&#039; s conic-Gradient()Polyfill的功能列表是最后一项:

静态表单提供商的比较 静态表单提供商的比较 Apr 16, 2025 am 11:20 AM

让我们尝试在这里造成一个术语:“静态表单提供商”。你带上html

如何在WordPress主题中构建VUE组件 如何在WordPress主题中构建VUE组件 Apr 11, 2025 am 11:03 AM

内联式模板指令使我们能够将丰富的VUE组件构建为对现有WordPress标记的逐步增强。

php是A-OK用于模板 php是A-OK用于模板 Apr 11, 2025 am 11:04 AM

PHP模板通常会因促进Subpar代码而变得不良说唱,但这并不是这样的情况。让我们看一下PHP项目如何执行基本的

三种代码 三种代码 Apr 11, 2025 pm 12:02 PM

每次启动一个新项目时,我都会将我正在查看的代码分为三种类型,或者如果您愿意的话。我认为这些类型可以应用于

See all articles