Home > Web Front-end > HTML Tutorial > Several ways to use html and css

Several ways to use html and css

零到壹度
Release: 2018-03-19 10:41:17
Original
1754 people have browsed it

This article mainly introduces you to several ways to use html and css. The editor thinks it is quite good. Now I will share it with you and give you a reference. Let’s follow the editor to take a look, I hope it can help everyone.

How to use HTML

1: Color code
If you want to use a certain color, get Its color value is sufficient. For example, if you want to change the color of some text, you can use the following code: Change the code after the # symbol to change the color

2: The code for bold and slanted text

◆The code for bold and slanted text is: Hello ◆The code for slanted text is: Hello! ◆Underline:


##3: Text link codeIf you want to click somewhere, the text will be connected The effect of going to another web page is a hyperlink. The code is as follows:
Shared spaceIf you click on this text and reopen a window, The code is: Shared space

Four: Code for placing images on the website
If you see I want to put a good-looking picture on the website. The code is like this:
## The number after # adjusts the size of the image.



Five: Picture link code

If you click on the picture to open a website, the link code is like this:
If you click on the picture, you can open a link to the website and reopen a window. The code is like this:
The above numbers can adjust the image size.



## Six: Line break code

If you want to change the line, just use the Enter key. You need to enter

at the position where you want to change the line. This will be displayed in two lines, and the entire website will not look like It’s a big piece, but the paragraphs are clear.

Seven: The code for moving text is
Write text here

Eight: The code for moving pictures

Just change the image address inside to yours. If you want to add one more image, just insert it in the middle according to the format:

You can decide the address of the pictures inside.

9: Background music code
If you want to put a piece of nice background music on your website, the code is:
You can replace the background music address inside by yourself. The first number of
is the music address, usually ending in the form of mid or mp3, and the following number is the number of plays.
http://www.midifan.com/midi/
This website has good background music

10: The code for inserting a flash animation into the website is
src="http://flash.shangdu.com/view/2/fff.swf";> Replace the animation address inside with yours. The animation address must be in the form of swf end. This needs attention.

11: Welcome code that appears when opening the website


12: Close If it appears when opening the website


13: Make a pop-up window advertisement when opening the website

The http://163.com/ inside is a web page you have prepared in advance. The following numbers are for adjusting the size and position. Test it yourself a few times.

Fourteen: The mouse sensor font turns red

The code is as follows: insert between

<span style="font-size: 16px;"><STYLE type=text/css>TD { <br/>FONT-SIZE: 12px <br/>} <br/>BODY { <br/>FONT-SIZE: 12px <br/>} <br/>INPUT { <br/>FONT-SIZE: 12px <br/>} <br/>A:link { <br/>COLOR: #000000; TEXT-DECORATION: none <br/>} <br/>A:visited { <br/>COLOR: #000000; TEXT-DECORATION: none <br/>} <br/>A:active { <br/>COLOR: blue; TEXT-DECORATION: none <br/>} <br/>A:hover { <br/>COLOR: red; TEXT-DECORATION: underline <br/>} .so { <br/>BORDER-RIGHT: 1px ridge; BORDER-TOP: #ffffff 1px ridge; FONT-SIZE: 12px; BORDER-LEFT: #ffffff 1px ridge; BORDER-BOTTOM: 1px ridge; BACKGROUND-COLOR: #cccccc <br/>} <br/></STYLE> <br/></span>
Copy after login

Fifteen: Prohibit others from copying the code of your web page:


16: Code for putting other web pages into your own web page:


Five tips for using CSS style sheets in web pages Method

1. Use the STYLE attribute

Add the STYLE attribute directly to individual component tags,< ;Component (label) STYLE="Property (property)1: Setting value 1; Property (Property)2: Setting value 2; ...}

For example:

The advantage of this usage is that it can flexibly apply styles to each label, but the disadvantage is There is no "unity" to the entire document.

2. Use the STYLE tag

Write the style rules in the tag.

For example:

<STYLE TYPE="text/css">
<!--
BODY {
  color: BLUE;
  background: #FFFFCC;
  font-size: 9pt}
TD, P {
  COLOR: GREEN;
  font-size: 9pt}
-->
</STYLE>
Copy after login

Usually the entire structure is written in the section of the web page. The advantage of this usage lies in the uniformity of the entire document. As long as there is a declared component, the style rule will be applied. The disadvantage is the lack of flexibility in individual components.

3. Use LINK tag

Write the style rules in the .css style file and import it with the tag.
Suppose we save the style rules as an example.css file, we only need to add
## to the web page #The style specified in the style file can be applied. Usually the LINK tag is written in the section of the web page. The advantage of this usage is that you can assign several documents to which the same style rules apply to the same style file. The disadvantage is also the lack of flexibility in individual files or components.


4. Use @import to introduce

It is very similar to LINK usage, but it must be placed in .


For example:

It should be noted that the semicolon at the end of the line is absolutely essential!

5. Use tag to introduce styles

For example: Webpage Teaching Network

The above is the detailed content of Several ways to use html and css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template