Saturday 30 September 2023

CSS Learning

Shall we learn CSS...??

What is CSS..?


CSS stands for Cascading Style Sheet. 
CSS is the language we use to style an HTML document. 
CSS describes how HTML elements are to be displayed. 
Also, CSS is used to control the style of a web document.
A CSS Style rule is made up of 3 parts.

  • Selector: The HTML element at which a style will be applied.
  • Property: A type of attribute of HTML tag.
  • Value: The value assigned to properties.





Adding a Stylesheet to an HTML Document
 
There are 3 ways we can add a stylesheet to an HTML document.

  • External Stylesheet
An external style sheet can be written in any text editor and must be saved with a .css extension and the external . CSS file should not contain any HTML tags.

HTML Code:-


CSS Code:-


Output:-



  • Internal Stylesheet
Internal style sheets may be used if one single HTML page has a unique style. 
The internal style is defined inside the <style> element, inside the head section of the HTML page.

HTML Code with Internal CSS:-


Output:-



  • Inline Styles
An inline style may be used to apply a unique style for a single HTML element. 
To use inline styles, add the style attribute to the relevant element. 
The style attribute can contain any CSS property.

HTML Code with Inline CSS:-


Output:-





Written by:  W.A. Eranga Dewmini


Java Script Learning

 Introduction to JavaScript JavaScript is the programming language used by front-end web developers to instruct the browser to add behaviors...