Skip to main content

Posts

Showing posts with the label selectors

11/100: Selectors in CSS

 Welcome to the 11 th day of 100 days web development challenge. Today is my 3 rd day of learning CSS for web development.  Using CSS feels like I have more control over the look and feel of my HTML documents. And honestly speaking, it is fun learning CSS because I'm able to change the color and position of my texts and paragraphs.  Today I learnt about "selectors" in CSS and wrote 5 HTML files that are styled using different types of selectors and uploaded those files on my  GitHub . Topics: What is Selector in CSS? Types of Selectors in CSS: Id Selector Element Selector Class Selector Universal Selector Grouping Selector What is Selector in CSS? A selector is an HTML tag at which style will be applied. This could be any HTML tag like <h1>, <p>, <table> etc. CSS selectors are used to "find" or as it's name suggests to "select" the HTML element that we want to give style to. To style, we first write the selector that is the name...

10/100 : Constructing Style Rule in CSS (Syntax of CSS)

 Welcome to day 10 of my 100 days web development challenge. Yesterday, I started with CSS which is used for styling html documents. I learnt the what , why and how of CSS and you can check it  here . Today, I learnt the following. Topic: Syntax of CSS 3 Parts of CSS Style Rule Syntax of CSS: An embedded style sheet consists of an opening and closing <style></style> tag which is placed between the <head> section of the HTML page. When we use CSS for styling an HTML element, the style rule begins with the name of that element. For example: if you are creating a rule that will apply to all instances of the <h1> tag, then start the rule with h1. < style >         h1     </ style > No brackets are necessary around h1 because it's already enclosed in the <style> tag. A CSS compromises of style rules that are interpreted by the browser and then applied to the corresponding elements in the HTML document. 3...