Search
 
SCRIPT & CODE EXAMPLE
 

CSS

CSS Or Selector

*:is(.a, .b).c{...}
Comment

css is selector

/*Below is a peice of code that allows us to set the cursor style for 
a specific class (.seat) that does not have the class (.occupied)*/
.seat:not(.occupied):hover{
  cursor: pointer;
  transform: scale(1.2);
/*The code below allows us to set properties for a seat that is occupied;
This changes the curser on hover, indicating that the option is not available.*/
.seat:is(.occupied):hover{  
  cursor:not-allowed;
}
 
Comment

CSS Selector


.class1.class2 	    .name1.name2 	Selects all elements with both name1 and name2 set within its class attribute
.class1 .class2 	.name1 .name2 	Selects all elements with name2 that is a descendant of an element with name1

*                	* 	        Selects all elements
element 	        p 	        Selects all <p> elements
element.class       p.intro 	Selects all <p> elements with class="intro"
element,element 	div, p 	    Selects all <div> elements and all <p> elements
element element 	div p 	    Selects all <p> elements inside <div> elements
element>element 	div > p 	Selects all <p> elements where the parent is a <div> element
element+element 	div + p 	Selects the first <p> element that is placed immediately after <div> elements
element1~element2 	p ~ ul    	Selects every <ul> element that is preceded by a <p> element


/*Attribute selectors*/
    p[class="review"] /*all of paragraphs with review class on them*/
    img[href^="../my code guide/"] /*every image that starts with that addres (replacing "=" with"^=")*/
    img[href$="../my code guide/"] /* its end with this attribute*/
    img[href*="../my code guide/"] /*if its contain anywhere*/
    h1[class~="site-header"] /*only works with white space seperator*/
    h1[class|="subtitle"] /*selects ones that start with "subtitle" or "subtitle" and "-" in following*/
Comment

what is css selector

div { color: red; } // the "div" in .css is a selector targeting all <div> elements
simpleSelector = document.querySelectorAll()("div"); // all divs 
complexSelector = document.querySelector("div.user-panel.main input[name='login']")  // the first <input> element with the name "login" (<input name="login"/>) located inside a <div> whose class is "user-panel main" (<div class="user-panel main">) in the document is returned
Comment

PREVIOUS NEXT
Code Example
Css :: css flex 
Css :: bootstrap-navbar-containers 
Css :: datepicker disable future date odoo 
Css :: display flex 
Css :: flex box 
Css :: error 404 flask on css file 
Css :: Latest compiled and minified CSS 
Css :: css clamp vs media queries 
Css :: tailwind transition 
Css :: box-sizing 
Css :: css outline shorthand 
Css :: css animation-name 
Css :: css custom underline color 
Css :: Responsive Web Design - Media Queries 
Css :: css structure 
Css :: add tailwind to next 
Css :: What is the "style", when creating an internal CSS? 
Css :: box shadow css transition 
Css :: account system php html 
Css :: line height negative css 
Css :: hiding text css and leaving whitespace 
Css :: vertical multi color border css 
Css :: background shorthand code 
Css :: what is focus state in css 
Css :: find_element_by_css_selector link 
Css :: css padding top screen height 
Css :: how to scroll only in one direction in css 
Css :: sass rainbow color background 
Css :: image with colored background html css tigether 
Css :: how to apply css on react chartjs 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =