Anonymous
Not logged in
Talk
Contributions
Create account
Log in
WikiKnowledgeBase
Search
Editing
Technology/Software Development/Web development/CSS
(section)
From WikiKnowledgeBase
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== CSS Selectors == CSS selectors determine which elements on the web page will be affected by the styles defined in the CSS rules. There are several types of selectors: * '''Element Selector''': Targets elements based on their tag name. For example, to style all paragraphs, use '''p''' as the selector. * '''Class Selector''': Targets elements with a specific class attribute. The class selector is denoted by a dot (.) followed by the class name. For example, to style all elements with the class "highlight", use '''.highlight''' as the selector. * '''ID Selector''': Targets a specific element with a unique ID attribute. The ID selector is denoted by a hash (#) followed by the ID name. For example, to style an element with the ID "header", use '''#header''' as the selector. * '''Descendant Selector''': Targets elements that are descendants of another element. It is denoted by a space between selectors. For example, to style all list items inside an unordered list, use '''ul li''' as the selector. * '''Pseudo-class Selector''': Targets elements based on a specific state or condition. Pseudo-classes are denoted by a colon (:) followed by the pseudo-class name. For example, to style a link when it is hovered over by the cursor, use '''a:hover''' as the selector.
Summary:
Please note that all contributions to WikiKnowledgeBase may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
My wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Random page
Categories
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs