Web development-Starting from the Foundation 2

Source: Internet
Author: User

Four styles of a hyperlink

Assume a hyperlink <a href = www.561.cn> This is a hyperlink </a>

a:link {color: #FF0000}/* Link not visited */a:visited {color: #00FF00}/* Visited link */a:hover {color: #FF00FF}/mouse move to link */a:act ive {color: #0000FF}/* Selected link */

The above defines the link style when the hyperlink is not visited, the link style that has been visited, the link style when the mouse is moved, and the selected link style. It is called a pseudo-class, that is, it is not a real class, the normal class is to start with a point, followed by a name, and it is a beginning with a colon, followed by a state-qualified character.

Ii. converting links to block-level elements

Links are inline elements by default and can be converted to block-level elements for a larger click area, set width and height, convert links to blocks, and simply add a display:block CSS property.

a {display:block; height:30px; width:100px; line-height:30px; text-align:center; background: #CCC;} a:hover {color : #FFF; Text-decoration:none; Background: #333; }

Third, make the button with CSS

a {display:block; height:34px; width:107px; line-height:2; text-align:center; Background:url (/upload/2010-08/14/014 304_btn_bg.gif) no-repeat 0px 0px; Color: #d84700; font-size:14px; Font-weight:bold; Text-decoration:none; padding-top:3px; } a:hover {Background:url (/upload/2010-08/14/014304_btn_bg_hover.gif) no-repeat 0px 0px;}

Four, the first word sinking

p {width:400px; line-height:1.5; font-size:14px;} p:first-letter {font-family: "Microsoft Yahei"; font-size:40px; f Loat:left; padding-right:10px; Line-height:1; }

V. Horizontal graphic list four, floating stepfather container height adaptive

When an element inside a container floats, it will not increase as the height of the inner element increases, resulting in the display of content elements beyond the container.

To solve this problem, you need to use the following styles

Overflow:auto; Zoom:1;

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.