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.
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 The code is as follows: insert between Fifteen: Prohibit others from copying the code of your web page:
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
Eight: The code for moving pictures<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>
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:
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>
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. 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
For example:
It should be noted that the semicolon at the end of the line is absolutely essential!
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!