Learning something new

Priscilla Martinez
2 min readOct 3, 2020
A laptop displaying code on the screen.

“What excites you about coding? How do you think it can change the world?”

Coding is an art. A developer can take their creative ideas and build something that people around the globe can have access to. This is what excites me about coding. I can take my own creative ideas, and turn them into something tangible that anyone, anywhere can use. I believe coding has already and continues to change the world. Coding solves some of the world’s greatest challenges everyday.

“What does doctype do at the top of your html file? Why does this need to be specified?”

Doctype, or document type declaration, tells the browser which type of document and version of HTML is being used. This allows the browser to identify how to render the document. If the doctype is not declared, then the browser will use quirks mode to render the document.

“Explain how a browser determines what HTML elements match a CSS selector?”

Browsers use key selectors to match the HTML elements with their respective CSS selectors. Browsers use right to left parsing to match CSS selectors with the appropriate HTML elements. This is more efficient than matching from left to right.

“What’s the difference between an HTML element and and HTML tag?”

An element is made up of an opening tag, any attributes or values, the content between the opening and closing tag, and a closing tag. A tag is simply the opening or closing tag used to indicate the start or end of an element.

“In your own words, explain the cascade of CSS?”

The order of your source code matters. If you assign an element a property and value twice or more times in your stylesheet, it will only look at the latest declaration and apply that rule to your element. Another factor that affects the cascade is specificity. A class, for example, is more specific than an element. A class selector will always take precedence over an element selector. Further yet, ID selectors are more specific than class selectors and will always take precedence over class and element selectors.

“Explain, to someone you know, the 3 ways to link/use CSS in an HTML file to style a web page.”

In your HTML document, in the <head> section, you want to add a link tag. Within this link tag there is some information needed to be able to link the CSS stylesheet to the HTML document: <link rel=”” href=””>. First, you need to specify the relationship or rel of this document being linked. Simply insert the value “stylesheet”. Next and final step is providing the href attribute with the location of your CSS stylesheet. Here you would type in the name of your stylesheet followed by .css. An example could look like: “styles.css”.

--

--