a:hover { color: blue; }
element. first-line - Selects the first line of every
element. first-child - Selects every
elements that is the first child of its parent. before - Insert content before every
element. after - Insert content after every
element. lang(language) - Selects every
element with a lang attribute value starting with "it". not(class, element or id) - Selects all the elements, classes or ids pre-mentioned (before the not) which do not match the classes, elements or ids within the not class. Linking CSS To a HTML Element: To link your CSS to an HTML element (text, div, etc.) you will need to decide whether you want to use a class or id, you will also need a unique name. Once you have those, go to your element in HTML and add...
class='myClass'
id='myID'
.myClass { //Properties go here }
#myID { //Properties go here }
<html> <head> <style> a:hover { color: orange; width: 300px; height: 100px; // Activated for all links when the mouse is hovering over it''s area. } a:visited { color: blue; width: 300px; height: 100px; // Activated for all links when it is or has been visited by the user. } img { width: 300px; // Sets image width back to normal when it is no longer hovered over. } img:hover { width: 600px; height: 100px; // Activated for all images when it is hovered over. } a:not(.notThis) { color: green; width: 300px; height: 100px; // All links but the ones with the class notThis. } </style> </head> <body> <a href='http://sourcecodester.com'>Normal link to sourcecodester.com</a> <a href='http://sourcecodester.com' class='notThis'>Normal link to sourcecodester.com except this one won't take in to account the a:not(.notThis) css styling since it has the .notThis class.</a> <img src='http://www.sourcecodester.com/sites/all/themes/arras/logo.png' />Normal image from sourcecodester.com. Hover over it...</a> </body> </html>