« Web, HTML, Tech Forum

My shitty CSS copypasta to help people out:

Posted by H3

posted
updated

Forum: Web, HTML, Tech


this will save your life : https://www.w3schools.com/cssref/default.asp
Also watch https://www.youtube.com/watch?v=QEJoDPAB8M4

How do you apply a property to an element:

First you specify one or multiple elements. (they are separated by commas) then you put all propertys followed by a semicolon into curly braces. like this:

element1, element2, ... {property1: value1; property2: value2; ...}

the properties and values you can look up in the W3S reference.

Now how do you get the elements?

Raw HTML elements are defined without anything. like: `h4` for all 4rth biggest headings or `img` for all images. If you want to select sth more specific you usually go by class or id. classes are just the class name with a dot ( . ) infront of it. IDs are are the same but you do use a hash ( # ) instead.

now how do you get the class or id names? Use the method from the video: press F12 on your keyboard, select the element in question, and look for its class/id or the one of an above element.


Report Topic

0 Replies