Skip to main content

Day3: Override CSS

Day 3 of #100DaysOfCode Challenge

Basic CSS: Override Styles in Subsequent CSS


Example 1:

<style>
body {
background-color: black;
font-family: monospace;
color: green;
}

.pink-text {
color: pink;
}

.blue-text {
color: blue;
}

</style>

<h1 class="pink-text blue-text">Hello World!</h1>
<!-- OR -->
<h1 class="blue-text pink-text">Hello World!</h1>
OutPut:




No matter blue-text pink-tex or pink-text blue-text, the output is the same.


The .blue-text is declared later, and it will override the .pink-text.


Example 2:

Now adding an id selector to example 1 and declaring it to <h1> Rest of the code remains the same.


#orange-text {
color: orange;
}


<h1 class="pink-text blue-text" id="orange-text">Hello World!</h1>

Override Class Declarations with Inline Styles

The inline CSS overrides class and id tags. 


Override All Other Styles by using Important

Using !important will override all the CSS stytles. 100% sure that the pink color is applied. 

#100DaysOfFitness Challenge

Day3: 10km Morning Cycling


#100DaysOfWriting Challenge

Completed writing Things to do article, need to revise. I was working on it for three days.

With Love,
Vasant V Patil

Comments

Popular posts from this blog

JS: higher order function

const realNumberArray = [ 4 , 5.6 , - 9.8 , 3.14 , 42 , 6 , 8.34 ]; const squareList = (arr) => { "use strict" ; // change code below this line const squaredIntegers = arr.filter(num => num > 0 && num% 2 == 0 ).map( num => num * num); // change code above this line return squaredIntegers; }; // test your code const squaredIntegers = squareList(realNumberArray); console.log(squaredIntegers); https://learn.freecodecam https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions/ p.org/javascript-algorithms-and-data-structures/es6/write-higher-order-arrow-functions/

Basic JavaScript: Record Collection

Basic JavaScript: Record Collection https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/record-collection/ // Setup var collection = { "2548" : { "album" : "Slippery When Wet" , "artist" : "Bon Jovi" , "tracks" : [ "Let It Rock" , "You Give Love a Bad Name" ] }, "2468" : { "album" : "1999" , "artist" : "Prince" , "tracks" : [ "1999" , "Little Red Corvette" ] }, "1245" : { "artist" : "Robert Palmer" , "tracks" : [ ] }, "5439" : { "album" : "ABBA Gold" } }; // Keep a copy of the collection for tests var collectionCopy = JSON.parse(JS...

Day 6.7, 8

Day6,7 and 8 of #100DaysOfCode  #Day6 My first CSS animation: https://t.co/G64mHnP9XQ Completed 122 of 1408 coding challenges on freeCodeCamp. Tomorrow will be playing with CSS animations. #100DaysOfCode — Vasant Patil (@vasantvp24) August 6, 2018 D7: Working on a single page responsive site. Will share the code on completion. #100DaysOfCode pic.twitter.com/OCU2Nq8I27 — Vasant Patil (@vasantvp24) August 7, 2018 R1D8 #Day8 #100DaysOfCode Worked on the showcase image and to center the text contained in it. Also, Completed Applied Accessibility @freeCodeCamp #CodeNewbie pic.twitter.com/IPupn4laGO — Vasant Patil (@vasantvp24) August 8, 2018 #100DaysOfFitness   Day 8: Best thing about cycling is you can enjoy the nature. #MonsoonSeason #Cycling #100daysoffitness #Hubli pic.twitter.com/DrxstaAtmm — Vasant Patil (@vasantvp24) August 8, 2018 Day7 #100DaysOfFitness #Cycling #Hubli pic.twitter.com/6DIL82bOgS — Vasant Patil (@...