What are the best practices associated with using classes vs. ids?
Classes and ids are all selectors that is used in CSS (Cascading Style Sheets)
Seletors allows you to taget specific elements on a web page that you can apply styles to.
The ID selector is the "the King of all the selector", which mean it will overiders other selectors
so the best practices is to define style rules that apply to a single element on the web page
A class selector allows you to define style rules that apply to any element with a class attribute equal to a certain value.
How do you apply classes and ids in HTML and css
ID selectors are defined using a hash sign. They are immediately followed by the ID value that you want to apply a set of style rules to. Here is an example of the ID selector in action:
This style applies to the p element in our HTML document with the ID "email . The style will set the color of the text in the element to black and potition to center, the font size to 10px
Class selectors are defined using a period, followed by the value of the class that you want to apply a set of styles to. Here’s an example of the class selector in action:
>
This style sets the background color of our div tag to lightgreen.
Technical Blog - sprint 3
it like a house. HTMl is the structure of the house. CSS is the decoration of house. JavaScript will be the furniture and electricity of the house which make the house more livable
Control flow is like driving a car. Frist, you need to have a car and start the engine, then driving. The loop is like the repetition of the "driving process"
The DOM is document as nodes and object. you can just use "document.getElement" to obtaine and motify the element thru JavaScript
I tend to focus too much on the details, which means I sometimes get curious and distracted by a little thing of a project – In my uni life, sometimes I can end up spending one or two hours reading something that’s only very slightly relevant to the project.
Arry is list of data and stored in Order. Object contains multiple values in a single variable.
Functions is like different furniture in a house which performs a particular task.