web development
HTML
HTML stands for Hyper Text Markup Language. Here are some fundamental of HTML.
1.The angle brackets, "<>", are used to enclose a code. Anything that goes in between the angle brackets codes for a property or an expression. Together, these 2 form a tag.
2.At the start of an HTML document, declares that the document is a HTML, for the browser to read and run the page.
3.An HTML element tells a browser how to display a content. It is defined by a start tag, content, and an end tag.
for eg.
4.Attributes provide additional information about the element, for example href, src, width, and style.
5.'class' attribute marks an element for styling and can be used repeatedly in a document.Meanwhile, 'id' attribute is unique and can only be used within the page once.
6.The image below shows more HTML elements and properties.
CSS
CSS stands for Cascading Style Sheets
Here are the basics of CSS:
1.Syntax: A CSS rule consists of a selector, a pair of curly brackets, property and value declaration separated by a colon, and a semicolon to separate multiple declarations.
--> p {color:red; text-align:center}
2.Simple Selectors: If an element is selected, the name can be written on its own. If a class is selected, a fullstop '.' will be written before the class name. If an ID is selected, a hashtag '#' will be written instead.
-->body{ , .Header{ , #slide1{
3.Combinator Selectors: Different selectors are combined together to make the selection more specific. Selectors are placed side by side without spacing.
-->div.Content{
To use multiple selectors to specify the ancestor of an element, a space is added.
-->nav a{
To give the same properties to multiple selectors, a comma is used.
--> ul, .names, #header{
4.There are 2 ways to input CSS: It can be added inline with HTML elements. OR
It can be added as a element in the head if an HTML document.
However, the 2 methods above can only be used once in an element or one HTML page. It is very time consuming to rewrite the same styles many times. Furthermore, HTML's purpose is to contain the structure of a webpage and not styling the content. Hence it is recommended to store as an external CSS file and attach it in an HTML document.