This article mainly introduces the CSS class selector and ID selector difference, small series think very good, and now share to everyone, but also for everyone to do a reference. Follow the small part together to see it, hope to help everyone better learn CSS class selector and ID selector.
css| Web page
CSS pseudo classes are used to add special effects to certain selectors.
CSS Pseudo Class (pseudo-classes) instance:
Hyperlinks
This example shows how to add a different color to a hyperlink in a document.
Hyperlink 2
This example shows how to a
One of the methods is to change the CSS class of page elements. In traditional JavaScript, we usually implement it by processing the classname feature of HTML Dom; jquery provides three methods to implement this function. Although they share the same idea with traditional methods, they save a lot of effort.
Code . -"Jquery makes JavaScript code concise !"
1. addclass ()-add
REM article title: Using the VBS class to implement CSS buttons
REM Author: Yanek
REM Contact: aspboy@263.net
Class Cssbutton
Public Name
Public BackColor
Public bordercolor
Public Font
Public FontColor
Public Width
Public Text
Public URL
Public Mouseovercolor
Public Function Generatestyletag ()
' Create ' STYLE tag
Dim Strstyle
Strstyle = """#mybutton" Name "
Class attribute Modification
Class attributes, which are class attributes, specify the name of the classes.When specifying a style with a class selector, you need to specify the class name, which is the value of the class attribu
In CSS, the class selector is displayed with a point number:
. Center {Text-align:center}
In the above example, all HTML elements that have the center class are centered.
In the following HTML code, the H1 and P elements all have the center class. This means that both wil
There are also differences between the various CSS selectors and the introduction of style sheets. import a style sheet to introduce some pseudo-class selectors and import selectors.
(1) CSS selector:
1. Tag Selector:Select the tag directly using the HTML Tag Name
2. class selector:The. selector name {} is
CSS: Cascading style sheet cascading ( [kæ ' Ske?d??] cascading) style SheetCSS BASIC Syntax structure: selector {attribute: value;attribute: value;...}Three main selectors:Tag Selector:A selector named after the HTML tag that directly controls the corresponding labelP{font-size:16;}Class selector:Add the class attribute to the tag, and the selector name is "."
(a) CSS selector:
1. Tag Selector: Select the tag directly from the HTML tag name
2. Class Selector: Select the label with the class attribute added by the name {} of the. Selector
3.ID selector: Select the tag with the id attribute added by the # selector name {}, which is the only one in the HTML document
4. Universal selector: Select all the tags in the HTML
CSS Class and ID selector, CSSClassID Selector
9. CSS Class and ID Selector
The difference between id and class indicates that the same ID of a page can only be used once, but the class can be used without restriction.Similarly, y
JQuery modifies class attributes and CSS styles, and jquerycssJQuery modifies class attributes and CSS stylesClass Attribute ModificationSpecifies the class name. when specifying a style with the class selector, you must specify t
A class is used to define one or more elements based on user-defined criteria. A more appropriate analogy is the script: A class can define the story line for each character in the script, and you can use it through css,javascript. So you can use class= "Frodo" on one page, class
Pseudo-Class in 1.CSS
CSS pseudo-classes are used to add special effects to certain selectors.
Grammar:selectorpseudo-class{property: value}CSS classes can also be used in conjunction with pseudo-classesselector.class: pseudo-
This article mainly explains how to modify the class attributes and CSS styles of jQuery. For more information, see.
Class Attribute Modification
Specifies the class name.When specifying a style with the class selector, you must specify the
One of the methods is to change the CSS Class of page elements. In traditional Javascript, we usually implement it by processing the classname feature of HTML Dom; jQuery provides three methods to implement this function. Although they share the same idea with traditional methods, they save a lot of code. -"JQuery makes JavaScript code concise !"1. addClass ()-add CSS
One way to do this is to change the CSS class (class) of page elements, which in traditional JavaScript is usually done by handling the classname features of the HTML DOM, and jquery provides three ways to do this. Although they are connected to traditional methods, they save a lot of code. Or the phrase-"jquery makes JavaScript code concise!" ”
1. AddClass ()-
Speaking of CSS Pseudo class, learningWeb Front EndWeb design of the students should not be very unfamiliar with this, many of the previous pages of the special effects are mostly through JS to achieve. But withCSS3continuous development, the use of CSS to achieve Web page effects not only good response, but also reduce a lot of code. Development of Web page code
loading screen with progress indicatorOn the following reference[2] "can find a short and clear revision of the problem of displaying local images in a uiweb View using CSS. To use relative paths or files in UIWebView, you have to load the HTML into the view with the correct base URL parameter. The following example shows how to does this:
12
nsstring *path Span class= "Crayon-o" >= [[ nsb
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.