Ten CSS skills to save development time

Source: Internet
Author: User

CSS has become a very important part of web page design. As there are many issues to consider when writing CSS, the old CSS framework is usually used to create new pages. However, new users do not have their own frameworks. This article will give new users some inspiration.

1. Simple pure CSS Tooltip

With this code, you can make a simple Tooltip. Here is the CSS code:

Copy to ClipboardReference: [www.bkjia.com] a: hover {
Background: # ffffff;/* if you want to be compatible with IE6, you must add a background color */
Text-decoration: none;
}
A. tooltip span {
Display: none;
Padding: 2px 3px;
Margin-left: 8px;
Width: 130px;
}
A. tooltip: hover span {
Display: inline;
Position: absolute;
Background: # ffffff;
Border: 1px solid # cccccc;
Color: # 6c6c6c;
}

The HTML code is as follows:

Copy to ClipboardReference: [www.bkjia.com] Easy <a class = "tooltip" href = "#"> Tooltip <span> This is a Example by imbolo.com. </span> </a>. effect.

2. Reset the basic style
To unify the rendering of the default styles of various HTML tags in different browsers, we must define the styles of various tags to facilitate future development. To redefine HTML tags, you only need to add the following code at the beginning of CSS. Copy to ClipboardReference content: [www.bkjia.com] html, body, div, span, applet, object, iframe,
H1, h2, h3, h4, h5, h6, p, blockquote, pre,
A, abbr, acronym, address, big, cite, code,
Del, dfn, em, font, img, ins, kbd, q, s, samp,
Small, strike, strong, sub, sup, tt, var,
B, u, I, center,
Dl, dt, dd, ol, ul, li,
Fieldset, form, label, legend,
Table, caption, tbody, tfoot, thead, tr, th, td {
Margin: 0;
Padding: 0;
Border: 0;
Outline: 0;
Font-size: 100%;
Vertical-align: baseline;
Background: transparent;
}
Body {
Line-height: 1;
}
Ol, ul {
List-style: none;
}
Blockquote, q {
Quotes: none;
}
Blockquote: before, blockquote: after,
Q: before, q: after {
Content: none;
}

/* The style when the element gets the focus! */
: Focus {
Outline: 0;
}

/* Special Text style! */
Ins {
Text-decoration: none;
}
Del {
Text-decoration: line-through;
}

/* Fine-line table style */
Table {
Border-collapse: collapse;
Border-spacing: 0;
} 3. Convenient CSS Debugger

This Code divides the labels nested on the page into different lines to help you identify bugs.

Copy to ClipboardReference: [www.bkjia.com] * {outline: 2px dotted red}
** {Outline: 2px dotted green}
* ** {Outline: 2px dotted orange}
* *** {Outline: 2px dotted blue}
* *** {Outline: 1px solid red}
* ***** {Outline: 1px solid green}
* ***** {Outline: 1px solid orange}
* ******* {Outline: 1px solid blue}

  • Three pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • Next Page

Related Article

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.