Make the homepage button look beautiful

Source: Internet
Author: User
Tags format button type print format reference
Button

Do you do the homepage is the same as others, look uniform, no character, whether you want to change the Web page look like it? Have you heard of the style table? Is the CSS, it is the one that allows you to more accurately control the pages of the stuff. Let's take a look at two examples first:

1. Turn the button background from gray to yellow, following is the code:

〈form method=″post″>

〈input Type=″button″value=″ Button ″name=″b1″

Style=″background-color:rgb (255,255,0) ″>

〈/p>

〈/form>

Can you understand? Form label you don't have to tell me? is the label of the form, followed by the description of the button type, where the button is the normal command button! Then, please note that something important is coming! Style: Description Here adopts a style form, and Background-color is used to declare the background color properties of the button, followed by RGB (255,255,0) gives its attribute value, here is yellow!

2. The color of the text of the button turns red, the font becomes italics, the code is as follows:

〈form method=″post″>

〈input Type=″button″value=″ Button ″name=″b1″

Style=″background-color:rgb (255,255,0); Font-family: italics _gb2312; Color:rgb (255,0,0) ″>〈/p>

〈/form>

Let's see if there's something more. By the right, there are two more attributes. One is font-family, one is color, the previous one is the font properties, the latter is the color properties of the font, their values are: italics _gb2312 and RGB (255,0,0), description text is red in italics, OK, Take a look at what is called a style form by using these two examples,

First of all, what do you call a style form? If you've ever used word, you'll know that you just need to set up a layout and print format. So all the pages in the file have the same format, and the style sheet is the same thing, the same Web site only needs to provide a style form, and then reference it on all pages, then the entire site will have the same format. A single style sheet is divided into three types.

The first is an external Web page style form. It is a CSS suffix name file, the equivalent of a template, set up in the page only need to reference it inside, you can make the referenced pages have the same format.

The second is an inline web page style form, which is generally stated in < head>...

The third type is called an inline style form for a piece of text, a table, or a graphic. In the front, we are using this style form, note that it is usually followed by a familiar HTML tag, such as the input tag of the previous text, followed by a style with some attributes and attribute values. and use them to accurately control the label! The property is separated from the property value by a colon, separated by a semicolon between the property and the property. The usual structure is as follows:

Well, with the above theoretical knowledge, let's contact the actual, let's look at a more complicated example:

〈form method=″post″>

〈input Type=″button″value=″ Button ″name=″b1″

Style=″font-family: Official script; font-size:9pt; Background-image:url

(' file:///D:/Inetpub/wwwroot/asp/wwwboad/IMAGES/asp400.jpg '); Border-left:medium Ridge RGB (128,0,0); Border-right:medium none rgb (128,0,128); Border-top:medium none rgb (0,255,0); Border-bottom:medium Ridge RGB (255,0,0) ″>〈/p>

〈/form>

In fact, the form and I said earlier is the same, but more than a few attributes, first font-family: official script; Font-size:9pt to explain the button text is 9PT size of the official script, followed by the background button is a picture, with a background-image attribute. Again, a Border-left attribute is used to indicate that the left border of the button is uplifted, with a dark red line and a medium thickness. The rest can be so and so on!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.