Thursday, November 10, 2022

Type of css

Type of css

Type of CSS


 1. Inline CSS 

It helps you to apply unique style rules in specific HTML elements. Right next to the text it decorates. The style attribute specifies properties and values. Inline styles are placed right where you need them, next to the text or graphic you wish to decorate. You can insert inline styles anywhere in the middle of your HTML code, giving you real freedom to specify each web page element. To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.


Inline CSS :-

Example 

<!DOCTYPE html>

<html>

<body>

<h1 style="color:green">This is a heading</h <p style="color:blue">This is a paragraph.</

</body>

</html>

Inline CSS 

output 

  

Inline tag use

2)2. Internet CSS 

An internal style sheet may be used if one single HTML page has a unique style. In this way. at the top of a web page document.  When you embed a stylesheet you write the style rule directly within the HTML document. You have to enclose the style rules within the <style> and </style> tag pairs and place this pair within the head section of the HTML document. With the style tag Type attribute is used to define to define the format of stylesheet you are using


Internet CSS 

Example 

<!DOCTYPE html>

<html>

 <head>

 <style>

body {

background-color: light-green; 

font-size: 20px;

 }

h1 {

color: maroon; 

margin-left: 10px;

}

 </style>

 </head>

<body>

<h1>Internal Style Sheet</h1> <p>Internal styles are located at the top of each web page, before any of the content is listed. This is the next best thing to external, because they're easy to find, yet permit you to 'override' an external style sheet for that special page that wants to be an individualist. </p>

</body>

</html>


Internet CSS

 output 

Internet Tag use


3. External CSS 

External style sheet keep the style rules in a separate file, apart from the HTML document. In a separate file An external CSS file can be created with any text or HTML editor such as "Notepad", "Notepad++" or "Dreamweaver". A CSS file contains no HTML, only CSS. You simply save it with the .css file extension. The advantage of using external style sheets is that you can apply the same style rules to more than one document in your Website. This enables you to quickly change the appearance of your web page in the future. By defining your styles in a single document and linking them to multiple pages, you only need to edit the style sheet to change the presentation style to all pages linked to it. You can link to the file externally by placing one of the following links in the head section of every HTML file you want to style with the CSS file.


External CSS

 Example 

<!DOCTYPE html>

<html>

<head>

<link rel="stylesheet" type="text/css" href="myFirstStyleSheet.css">

</head>

 <body>

<h1> External (In a separate file) </h1> <p> External style sheets are separate files full of CSS instructions (with the fil When any web page includes an external stylesheet, its look and feel will be contr file. This is how you change a whole website at once. And that's perfect if you wa latest fashion in web pages without rewriting every page. </p> 

</body>

 </html>


External CSS output 

External Tag use


CSS Selectors


The CSS selector is used to select the elements that you want to style. It select the HTML element ccording to its id, class, type, attribute etc. The selectors are the part of css rule set which contains e selector name and the declaration block.


CSS Syntax 

Selector {Property1: value1; Property2: value2;..........


A CSS rule set contains a selector and a declaration block which is shown below:  


CSS syntax


VISIT THE LINK 


introduction-to-web-design

client and scripting language

website information


Wednesday, November 9, 2022

CSS introduction


       Introduction to CSS 

CSS LOGO




CSS stands for Cascading Style Sheets. It is used to format the layout's of web pages in the website. It describes how HTML elements are to be displayed on screen, paper, or in other media. It takes care of the presentation and helps you determine how the pages and content that you make with HTML are going to look and display. It can control the layout of multiple web pages all at once.


The name cascading comes from the specified priority scheme to determine which style rule applies more than one rule matches a particular element. The CSS specifications are maintained by the rld Wide Web Consortium. Before CSS, If we want to assign a typographic characteristics to say, all H2 headings had to repeat HTML presentational markup for each occurrence of that heading type. This made documents more complex, larger, more error-prone and is difficult to maintain.

To solve this problem, the World Wide Web Consortium created CSS. It removed the style formatting from the HTML page! It also Saves a Lot of Work and Time. The style definitions are normally saved in external .css files. With an external CSS file, you can change the look of an entire website by changing just one file at a time. CSS (Cascading Style Sheet) describes the HTML elements which are displayed on screen, paper, or in other media. It saves a lot of time. It controls the layout of multiple web pages at one time.

CSS allows the separation of presentation from structure. CSS can define color, font, text alignment size, borders, spacing, layout and many other typographic characteristics and can do so independently for on-screen and printed views. CSS also defines non-visual styles, such as reading speed.

         Cascading Style Sheets, fondly referred to as CSS, is a simply designed language intended to simplify the process of making web pages presentable. CSS allows you to apply styles to web pages. More importantly, CSS enables you to do this independent of the HTML that makes up each web page. It describes how a webpage should look: it prescribes colors, fonts, spacing, and much more. In short, you can make your website look however you want. CSS lets developers and designers define how it behaves, including how elements are positioned in the browser.


While html uses tags, css uses rulesets. CSS is easy to learn and understand, but it provides powerful control over the presentation of an HTML document.

CSS saves time: You can write CSS once and reuse the same sheet in multiple HTML pages.

Easy Maintenance: To make a global change simply change the style, and all elements in all the webpages will be updated automatically.

Search Engines: CSS is considered a clean coding technique, which means search engines won’t have to struggle to “read” its content.

Superior styles to HTML: CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.

Offline Browsing: CSS can store web applications locally with the help of an offline cache. Using this we can view offline websites.


CSS Features 


Consistency :-

 With CSS, it is easy to make changes to the pages of your website. By making one change to your CSS stylesheet, you can consequently make it to each page of website. 


Appearance :-

With CSS, it is easy to improve the look-and-feel of the website from one place it allows you to use a wide array of extensive and expressive styles.


intainability :- 

Whenever a change is made to your website stylesheet, CSS allows you to omatically correct and change every page of your website.


Saves Time :-

With CSS, you only need to specify details of the styling once for any element and it will automatically apply the specified styles whenever that particular element occurs Hence, it saves a lot of time by not forcing you to rewrite everything again and again.


Advantage of CSS 


Easy maintenance:-

 To make a global change, simply change the style, and all elements in all the web pages will be updated automatically. 


Global web standards :- 

Now HTML attributes are being deprecated and it is being recommended to use CSS. So it's a good idea to start using CSS in all the HTML pages to make them compatible with future browsers. 


Platform Independence :- 

The Script offer consistent platform independence and can support latest browsers as well. 


CSS saves time :- 

You can write CSS once and then reuse the same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.


Ways to write CSS:- 

You can write CSS styles 3 way Inline element line, Internal style write in header section, or External style sheets enable you to change the elements and layout style of all the pages in a website, just by editing one single file



READ MORE 

inline css style

CSS Class Selector

css-text-properties

External CSS

CSS button

CSS inline block

Type of CSS

CSS Menu

CSS Margin Property

Tuesday, November 8, 2022

html input type

 

         Patterns attributes

Patterns attributes html


1) Number Type

<input type="number"> <input>

 elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries

 

Number type Example 

<! Doctype html>

<html>

<body>

<h2>Number Type</h2>

<form>

 Enter any number:

<input type="text" name="numbers"

 pattern="[0-9]*" title="numbers only">

<input type="submit">

</form>

</body>

</html>


Number type output


Number type tag use

2) Date type


<time>: The (Date) Time element


 The <time> HTML element represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.


Date type Example 

<! Doctype html>

<html>

<body>

<h2>Date type</h2>

<form>

 Enter any Date Format: DD.MM.YYYY: <br><br>

 <input type="text" name="numbers"

pattern="(0[1-9]1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}" title="Enter valid date"> <br><br>

<input type="submit">

</form>

</body>

</html>


Date type output

Date type use tag






3)date type (2)


<time>: The (Date) Time element. 

The <time> HTML element represents a specific period in time. It may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.


Date type Example

<! Doctype html>

<html>

<body>

<h2>date type</h2>

<form>

Enter any Date Format YYYY MM DD <br><br>

<input type="text" name="numbers"

 patterns (0-9)(4)-(0[1-01/012])-(0[1-910-920-9301])" title="Enter valid date"> <br> <br

<input type="submit">

</form>

</body>

</html>


Date type output 

Date type use tag

4) Range type

 <input type="range">

 The defines a control for entering a number whose exact value is not important (like a slider control). Default range is 0 to 100. However, you can set restrictions on what numbers are accepted with the attributes below. max - specifies the maximum value allowed.


 Range type Example 

<! Doctype html>

<html>

<body>

<h2>Range type</h2>

Age: <input type="number" size="6" name="age" min="18" max="99" value="21"><br>

 Satisfaction: <input type="range" size="2" name="satisfaction min="1" max="5" value="3">

</Body>

</html>


 Range type output 

Range type use




5) iframe Tag


iframe Tag Example 

<!DOCTYPE html>

<html>

<body>

<h2>Example of HTML Iframes</h2>

<iframe src="Manish.htm" height="200" width="300" title="Iframe Example"></iframe> </html>

</body>

</html>

iframe Tag output 


iframe Tag use



READ MORE