HTML CSS, In this article, I want to write to you what is CSS and the introduction of CSS, as you all know that CSS is a part of programming that people builts the software using CSS or HTML or any other language for writing the code or some are using for building a website on the internet using CSS, so somehow here I will introduce for you the basic of CSS that from where you should start the language of programming. CSS stands for cascading style sheets and emphasized place when you are using HTML for structure, therefore, this is the HTML that allows embeds the video, images and other media. CSS comes for page layouts colors and fonts that all determined by HTML CSS. It brings style or layout to your page.
Table of Contents
Introduction HTML CSS
cascading style sheets originally designed for information, for the browser up to down in the past CSS is the only purpose to present information helping HTML, but nowadays the programmer is using the CSS for web page design.
- CSS (Cascading Style Sheets) form the present)on the layer of the user interface.
- Simply CSS defines how and where to display
HTML elements in a web page.
– Structure (HTML)
– Presenta)on (CSS) - CSS tells the browser how the element should be
presented to the user.
The Cascade
- The cascade defines the order of precedence for how conflicting styles should be applied.
- Different style sheet:
Different style sheet:
1. Author Style Sheets:
These are style sheets created by the author of the Web
page.
2. User Style Sheets:
User style sheets are set by the user of the Web page. These
allow the user to have more control over how the pages
display.
3. User Agent Style Sheets:
These are styles that the Web browser applies to the page to
help display that page. - Properties that are defined in each of the above
stylesheets are given a weight (precedence). - By default, the author style sheet has the most
weight, followed by the user style sheet, and
finally by the user agent style sheet.
Why CSS?
Therefore, in most of the academics, the teacher is asking why CSS? the students are giving the answer that I want to serve my nation, CSS is an important way to control your web pages how look? CSS can control your font’s, Images Styles, Text, colors, Backgrounds, and layouts but it is difficult to learn CSS all the part has coding studying too much coding you will be tired.
HTTP protocol What is HTTP and web protocols, for beginners
5 Reason to Learn CSS
- Modify how to look your site Design look how you want.
- Save your Money
- Earn Money
- Redesign your website quickly
- Build more Websites
- CSS helps you to keep the information the content of a document separate from the details of how to display it.
- Avoid duplicate)on.
- Make maintenance easier.
- Use the same content with different styles for different purposes.
- Precise control (Positioning and Fluid Layouts)
CSS saves 4me and make maintenance easy
- With CSS, we are able to create rules, and apply those rules to many elements within the website.
- When site-wide changes are required by a client, Since the content is completely separated from the design, we can make those changes in our Style Sheet and have it affect every applicable instance.
Pages load faster - Since rules are only downloaded once by the browser, they are cached and used for each page load, the use of CSS can lead to lighter page loads, and improved performance.
- This contributes to a lighter server load and lower requirements, which overall saves money for clients.
CSS Rules
- Style sheets are made up of rules.
- each rule has two distinct parts: a selector and a declaration.
- The selector specifies the element to which you want to apply a style rule.
- The declaration specifies the formatting for the selector.
- A declaration block consists of a list of declarations in curly braces ({}).
- Each declaration consists of a property, a colon (:), a value, then a semi-colon (;).
- example, in the style rule h2 {color: silver;}, the selector is h2 and {color: silver;} is the declaration. When applied to a page, this rule will make all level 2 headings appear in silver.
CSS Inheritance
- Tags you add inside other tags inherit the outer tag’s formatting unless you specify otherwise.
- For example, if you define a <body> style, any tags you nest within the <body> tags inherit that formatting.
- HTML inheritance makes it easy to keep the formaVng consistent as you add new items within an element.
- The inheritance relationships between different styles in a document are known as the cascade.
- A more specific style can be set on a child element which overrides the parent’s element’ style.
How to Insert a Style Sheet
- There are three ways of applying a style:
» External Style Sheet
» Internal Style Sheet
» Inline Styles - The style applies to a single HTML element as specified by style attribute.
- Inline style do not have selectors and declaration block, just write property: value;
– <p style=“color: blue;”>Paragraph Text</p>
Internal Style Sheet
- Internal style sheets exist within an HTML page, between the <HEAD> and </HEAD> tags.
- You might use an internal style sheet if your site consists of a single page or the style is applied to only one page.
Internal Style Sheet
<head>
<style type=”text/css”>
hr {color:blue;}
p {margin-leh:20px;}
body {background- image:
url(“images/back.jpg”);}
</style>
</head>
External Sheet
- style sheets are separate files with “.css”extension.
- External style sheets are useful because you can link them to more than one HTML document.
- You write all css rules in the .css file and links it to your HTML files.
- <head>
- <link rel=”stylesheet” href=”mystyle.css” />
- </head>
Colors
- A color is either a keyword (e.g. blue, green), or a
numerical RGB specifica)on. - A numerical RGB specifica)on can be:
– An RGB value in hexadecimal nota)on, which is a ‘#’
immediately followed by a 6 digit or 3 digit
hexadecimal number, i.e. #rrggbb or #rgb. E.g.
#ff0000, #f00
– An RGB value in func)onal nota)on, i.e.
rgb(rrr,ggg,bbb), rgb(r%,g%,b%) E.g. rgb(255,0,0),
rgb(100%,0%,0%)
conclusion
That’s all about the CSS the starting course of CSS that are for beginners. The Cascading style Sheets are using to help for HTML. will help you how to start the begginer of CSS.
No Responses