Lesson Details:
July 10, 2020
I: Introduction
As we know that we should write an article about programming languages so first we need to know what is programming language? Programming Language is a set of rules, which helps us to explain to the computer how we want it to do our tasks. But there are many different types of programming languages and each one has its own characteristics. If we talk about Programming Languages then we can say that it is a set of instructions given to a computer or a machine to accomplish a task.
II: Body
A: Section Review of understanding layout with css
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language such as HTML or XML. CSS describes for an author/web designer how elements should be displayed on screen, on paper, in speech, etc. It can also control how those elements interact with each other and the user. The following is the brief review of CSS:
What is Cascading Style Sheet?
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language such as HTML or XML. CSS describes for an author/web designer how elements should be displayed on screen, on paper, in speech, etc. It can also control how those elements interact with each other and the user. The following is the brief review of CSS:
The Authoring Role of CSS
In order to use CSS, you must have a basic knowledge of HTML and a working knowledge of a graphic editor such as Adobe Photoshop®, Corel Draw®, Microsoft Publisher®, etc. In contrast to HTML, it is not necessary to place tags around your text because CSS does not describe the content of a document; rather, it describes the style of a document. For example, the structural tags
, , ,
, ,
, etc., are not needed when using CSS since they are already implied by the style specified by CSS. The HTML tags
and still need to be used, however.
The Purpose of CSS
The purpose of CSS is to separate style (how things look) from content (what things mean). The separation of formatting from content allows you to change the formatting without modifying the content. For example, you might want to create a site that has some pages printed on green paper and others printed on pink paper. You can do this by creating two stylesheets that specify different fonts, margins, header positioning, etc.
The Benefits of CSS
CSS makes it easy to maintain documents because you can update the style sheets instead of manually changing every occurrence of the style in your documents. This makes it easier to change the look of your entire site without having to go through hundreds of pages and make manual changes. You can also make global changes to the look of your documents quickly by updating the style sheet (e.g., change all h1 headings to red). Because style sheets are text files, they are easier to work with than graphical editors, which requires reloading your document each time you make a change. You can also apply stylesheets to multiple documents at once (i.e., define the same style twice). Finally, if you decide not to use an application's built-in style sheets (such as Microsoft Word), you can use CSS instead. This allows you to bypass proprietary features and retain more control over your documents' appearance.
The Limitations of CSS
CSS does not support all HTML elements. For example, it does not support tables, frames, or forms. Also, if you wish to have tables with borders around them, you need to include table tags in your documents. Furthermore, you cannot use HTML attributes within your style sheets because these are ignored by browsers that support CSS. These limitations are expected to be eliminated in future versions of CSS. Another limitation is that certain attributes must be specified for each element individually (e.g., background color for body, h1 headings must be specified separately from h2 headings). This may be viewed as both an advantage and disadvantage since it is easy to update the style sheet but at the same time, it may be difficult to see what styles are being applied where if you have multiple stylesheets defining various styles for various elements.
The Syntax of CSS
A simple example of CSS follows: p {color:blue} . This example states that all paragraphs should be blue in color. If you want all h1 headings to be red instead, then you would write h1 {color:red} . A style sheet consists of two types of rules: selector and declarations. Selector rules specify which part of a document will be affected by the declaration rules within the same style sheet. There are four basic selectors: type selector , ID selector , class selector , and pseudo-class . All four selectors follow the same syntax: [attribute] [element] [pseudo-element] [class] [id] [PSEUDO]. Here are some examples: P[style="color:#00FF00"] {color:green} H1[style="color:#0000FF"] {color:blue} LI [style="color:#00FF00"] {color:green} UL LI [style="color:#0000FF"] {color:blue} P[STYLE] {color:green} H1[STYLE] {color:blue} LI[STYLE] {color:green} UL LI[STYLE] {color:blue} P[CLASS=red] {color:green} H1[CLASS=red] {color:blue} LI[CLASS=red] {color:green} UL LI[CLASS=red] {color:blue} P[ID=p123] {color:green} H1[ID=H123] {color:blue} LI[ID=LI2345] {color:green} UL LI[ID=UL3456789] {color:blue} P[PSEUDO=first-letter] {font-size:150%; color:red; font-weight:bold; position:absolute; top:-200px; left:-100px; padding:0; background-color:yellow;} H1[PSEUDO=first-letter] {font-size:200%; color:blue; font-weight:bold; margin-left:-50px; margin-top:-25px; padding:0; background-color:yellow;} LI[PSEUDO=first-letter] {font-size:150%; color:red; font-weight:bold; position: absolute; top:-200px; left:-100px; padding:0; background-color:yellow;} UL LI[PSEUDO=first-letter] {font-size:200%; color:blue; font-weight:bold; margin-left:-50px; margin-top:-25px; padding:0; background-color:yellow;}
This example illustrates how all paragraphs should be green in color while only the first letter of all headings should be blue in color. We can get four types of selectors based on specific properties defined for each HTML element. These are Type selector , ID selector , Class selector , Pseudo Class selector . Type selector : The Type selector refers to all elements belonging to one particular type . For example p denotes all paragraph elements . Class selector : The Class selector refers to all elements belonging to one particular class . For example p.red denotes all paragraph elements having red class . ID selector : The ID selector refers to one unique element among all . For example #p123 denotes one unique paragraph element having id = p123 . Pseudo class : The pseudo class refers to elements based on their state on the page . For example :link refers to all links on the page that are yet to be clicked . :visited refers to all links on the page that have been already visited . :hover refers to all links on the page when mouse is moved over them . :active refers to all links on the page when user clicks on them . :focus refers to all links on the page when they have focus or when they are active but user is not clicking on them yet . :target refers to all links on the page when they are targeted by fragment identifier in url . There are several other pseudo classes like :first , :last etc but most commonly used ones are listed above . Type selector + Class selector = Class selector Type selector + ID selector = ID selector ID selector + Class
Write a public review