Home Web Front-end HTML Tutorial html css basics_html/css_WEB-ITnose

html css basics_html/css_WEB-ITnose

Jun 24, 2016 am 11:58 AM
html+css Base

完整的HTML结构

 

   样式的引用

  一。内部编写

(if ues:   so use the style just 1 times)!!!

#div_css {}

(or ues:    so don't write"class or id =?" )

div.p {}

div p {}

二。外部引用

 

 超链接的样式

a {}         // all super links

a:link {}         //no linked links

a:visited{}           //alredy linked links

a:hover{}         //on mose move to the link 

a:action{}      // 点击时

 

  插入flash文件

 

                                               

  插入视频

 

 插入网页块

src="xx"

width=""

height=""

scrolling="auto"

frameborder="o"

name="xx">

 

插入表单

   

 一。文本输入(账号,密码)

账号

密码

 

 二。提交表单

  

 三。单选

xx

xx

 

四。多选

xx

xx

xx

 

 五。下拉菜单

     

六。列表(没有下拉)

                                    

  悬浮文字框

xx

     

  滚动文字

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

   

 

 表格

  //合并横向

  //合并竖向

xx
xx xx

 

 文字的一些属性

设置元素内容的文本属性

(1)举例设置文本首行缩进

   text-indent:2em;

(2)举例设置文本对齐方式

   text-align:left | right | center;

(3)举例设置文本修饰方式

   text-decoration:underline;

(4)举例设置字间距

   letter-spacing:2em;

(5)举例设置词间距

   word-spacing:0.5em;

(6)举例空白显示形式 P56

   white-space:pre;

外边距margin:围绕在元素边框之外的可选区域。

内边距padding:文本内容到边框之间的可选区域

 

 元素浮动

浮动:

float

有2个方向: left  right none(不浮动)

对于文字浮动,必须设置高度,宽度,如果不设,后后果自负。

清除浮动:

clear:none;  //允许元素的两边都可以有浮动

clear:left;  //不允许左边有浮动元素

clear:right; //不允许右边有浮动元素

clear:both;  //两边都不允许有浮动元素

 

  定位类型position

 分类:

static(静止)此为默认,即按照正常的文本流,占用正常的位置。

fixed(固定的) 相对于浏览器窗口定位(保留原位置)

 position:absolute;  

绝对定位:相对于父级元素(被包含容器)。

position:relative; 

相对定位:相对于没有设置position时的正常位置定位

原始空间会保留下来。(意思就是说按static的位置算的地方不会出现另外的标签。如DIV,IMG等等。)

例子:

哈,我是一个帅哥

是不是哦,我晕你

我看看行不行。

The running result is: Ha, I am a handsome guy. Oh, I fainted.

Explanation: "Ha I am a handsome guy" uses absolute positioning. It is positioned relative to the first DIV because the first DIV is its parent element and contains it inside. So it appears at the top of the header. (Because left and top are not set for it)

"Isn't it, I fainted you" is also absolute positioning. It is positioned relative to the first DIV and sets the left value to 160px, which is larger than the previous one. The width of the div, so it won't overlap.

"Let me see if it works" uses relative positioning. It is positioned relative to the parent element, that is, the first DIV. Its position is calculated from the very beginning of the parent element. , so if top is not set, it will overlap with the second div. The font size is generally 15px 🎜>

top: Cut the top length from top to bottom.

left: Cut off the length of left from left to right.

right: Cut out the length of right from left to right.

bottom: cut the length of bottom from top to bottom

Convert block-level elements into character-level elements

display:inline;

Convert character-level elements into block-level elements

display:block;

Handle overflow

position :absolute; (must be absolute)

overflow:visible; //The overflow area is visible

overflow:hidden; //The overflow area is invisible

overflow:scroll; / / Scroll bar appears in the overflow area

Box model

With margin padding border width height

When abbreviated, it is written in the order of right, bottom and left

For example: border-width: 1em 2em 2em 2em

Note: the attributes of top, bottom, left and right:

If only 3 values ​​appear during setting, it means top, left, and bottom

2 values: up, down, left and right

1 value: all = 4 identical values ​​appear

Insert multimedia

 

Reprinted

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP Basics Tutorial: From Beginner to Master PHP Basics Tutorial: From Beginner to Master Jun 18, 2023 am 09:43 AM

PHP is a widely used open source server-side scripting language that can handle all tasks in web development. PHP is widely used in web development, especially for its excellent performance in dynamic data processing, so it is loved and used by many developers. In this article, we will explain the basics of PHP step by step to help beginners from getting started to becoming proficient. 1. Basic syntax PHP is an interpreted language whose code is similar to HTML, CSS and JavaScript. Every PHP statement ends with a semicolon; Note

Learn the basics of Go language variables Learn the basics of Go language variables Mar 22, 2024 pm 09:39 PM

Go language is a statically typed, compiled language developed by Google. Its concise and efficient features have attracted widespread attention and love from developers. In the process of learning the Go language, mastering the basic knowledge of variables is a crucial step. This article will explain basic knowledge such as the definition, assignment, and type inference of variables in the Go language through specific code examples to help readers better understand and master these knowledge points. In the Go language, you can use the keyword var to define a variable, which is the format of the var variable name variable type.

Can I learn Linux from scratch? What do I need to learn? Can I learn Linux from scratch? What do I need to learn? Feb 19, 2024 pm 12:57 PM

If you want to work in the IT industry, but do you want to learn programming, which technology should you choose? Of course it is Linux operation and maintenance. Linux is a very popular technology on the market, with a wide range of applications and good employment prospects, and is liked by many people. So the question is, can I learn Linux operation and maintenance with zero basic knowledge? In the server market, Linux system has a market share of up to 80% because of its advantages such as stability, security, free open source, efficiency and convenience. From this, it can be seen that Linux applications are very popular. Extensive. Whether now or in the future, learning Linux is a very good choice. As for whether it is possible to learn from scratch? My answer is of course. Oldboy Education Linux face-to-face class is specially designed for people with zero basic knowledge

Introduction to PHP Basics: How to use the echo function to output text content Introduction to PHP Basics: How to use the echo function to output text content Jul 30, 2023 pm 05:38 PM

Basic introduction to PHP: How to use the echo function to output text content. In PHP programming, you often need to output some text content to a web page. In this case, you can use the echo function. This article will introduce how to use the echo function to output text content and provide some sample code. Before starting, first make sure you have installed PHP and configured the running environment. If PHP is not installed yet, you can download the latest stable version from the PHP official website (https://www.php.net).

Detailed explanation of C language functions: basic to advanced, comprehensive analysis of the use of functions Detailed explanation of C language functions: basic to advanced, comprehensive analysis of the use of functions Feb 18, 2024 pm 02:25 PM

C language function encyclopedia: from basic to advanced, detailed explanation of how to use functions, specific code examples are required Introduction: C language is a widely used programming language, and its powerful functions and flexibility make it the first choice of many developers. In C language, function is an important concept. It can combine a piece of code into an independent module, improving the reusability and maintainability of the code. This article will introduce the use of C language functions from the basics and gradually advance to help readers master the skills of function writing. 1. Definition and calling of functions in C

PHP study notes: Basics of object-oriented programming PHP study notes: Basics of object-oriented programming Oct 09, 2023 pm 12:46 PM

PHP study notes: Basics of object-oriented programming, specific code examples are required Introduction: Object-Oriented Programming (OOP for short) is a programming way of thinking that decomposes the problem into multiple objects and defines the interaction between objects. to solve complex programming problems. As a powerful programming language, PHP also supports object-oriented programming. This article will introduce the basic concepts and common syntax of object-oriented programming in PHP, and provide specific code examples. kind

PHP function usage: from basics to advanced PHP function usage: from basics to advanced Jun 15, 2023 pm 11:11 PM

PHP is a widely used server-side scripting language used to develop dynamic websites, web applications, and other Internet services. In the process of developing PHP applications, using functions can help simplify code, improve code reusability, and reduce development costs. This article will introduce the basic usage and advanced usage of PHP functions. 1. Basic usage of PHP functions 1. Define functions In PHP, use the function keyword to define functions, for example: functiongreet($name){

Reference methods relative to absolute positioning Reference methods relative to absolute positioning Jan 23, 2024 am 09:18 AM

Absolute positioning is one of the commonly used positioning methods in CSS. It controls the position of an element on the page by specifying the offset position of the element relative to its nearest "positioned" ancestor element. This article will introduce the basic concepts of absolute positioning and provide specific code examples to help readers better understand and apply this reference method. Absolute positioning is achieved by setting the position attribute of an element to absolute. When an element is set to absolute positioning, you can set top, bottom, left, r

See all articles