search
HomeWeb Front-endHTML Tutorial(一)css代码积累--自己经常忘记,但是总记不住的代码_html/css_WEB-ITnose

1.透明度设置

90%透明:filter:alpha(opacity=90);-moz-opacity:0.90;-khtml-opacity: 0.90;opacity: 0.90;

80%透明:filter:alpha(opacity=80);-moz-opacity:0.80;-khtml-opacity: 0.80;opacity: 0.80;

70%透明:filter:alpha(opacity=70);-moz-opacity:0.70;-khtml-opacity: 0.70;opacity: 0.70;

60%透明:filter:alpha(opacity=60);-moz-opacity:0.60;-khtml-opacity: 0.60;opacity: 0.60;

50%透明:filter:alpha(opacity=50);-moz-opacity:0.50;-khtml-opacity: 0.50;opacity: 0.50;

40%透明:filter:alpha(opacity=40);-moz-opacity:0.40;-khtml-opacity: 0.40;opacity: 0.40;

30%透明:filter:alpha(opacity=30);-moz-opacity:0.30;-khtml-opacity: 0.30;opacity: 0.30;

20%透明:filter:alpha(opacity=20);-moz-opacity:0.20;-khtml-opacity: 0.20;opacity: 0.20;

10%透明:filter:alpha(opacity=10);-moz-opacity:0.10;-khtml-opacity: 0.10;opacity: 0.10;

完全透明:filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;

 

2.字间距/字母间距、单词间距

字间距(字母间距):letter-spacing:5px

单词间距:word-spacing

 

3.同一组的单选按钮,name取值一定要一致。这样同一组的单选按钮才起作用。

 

4.在线QQ链接设置

 

5.copyright中的特殊字符

 © 

 

6.一键拨打效果电话号码

 

7.强制对数字字母折行

word-wrap: break-word; break-word: break-all;

 

8.背景色透明

background: rgba(0,0,0,0.6);

 

9.button的onclick事件打开新的页面/本地页面

当前页面直接跳转至新页面:
需要打开一个新的页面进行跳转,相当于a标签的target="_blank"属性:

 

10.圆角矩形代码

border-radius: 5px; border: 1px solid #fc959f;padding: 5px;

 

11.注释

单行注释以 // 开头。 多行注释以 /* 开始,以 */ 结尾。

在CSS中用/* 注释语句 */

在HTML中用

 

12.返回上一页

javascript:history.go(-1);

 

13.手机屏幕

 

14.线性渐变——不会常用到

background: linear-gradient(rgba(50,60,60, 1), rgba(50,60,60, 0.7));

 

Statement
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
What is the purpose of the <datalist> element?What is the purpose of the <datalist> element?Mar 21, 2025 pm 12:33 PM

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element?What is the purpose of the <progress> element?Mar 21, 2025 pm 12:34 PM

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

What is the purpose of the <meter> element?What is the purpose of the <meter> element?Mar 21, 2025 pm 12:35 PM

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

What is the purpose of the <iframe> tag? What are the security considerations when using it?What is the purpose of the <iframe> tag? What are the security considerations when using it?Mar 20, 2025 pm 06:05 PM

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

What is the viewport meta tag? Why is it important for responsive design?What is the viewport meta tag? Why is it important for responsive design?Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use HTML5 form validation attributes to validate user input?How do I use HTML5 form validation attributes to validate user input?Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What are the best practices for cross-browser compatibility in HTML5?What are the best practices for cross-browser compatibility in HTML5?Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

How do I use the HTML5 <time> element to represent dates and times semantically?How do I use the HTML5 <time> element to represent dates and times semantically?Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

See all articles

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools