MVC

  • Home
  • HTML
    • Overview
    • Formatting
  • Java Script
    • Overview
    • Validation
  • CSS
    • Overview
  • Sql
    • Overview
    • SQL Select
    • SQL Command
    • Advance Query
    • SQL Create
    • Function
    • Function vs StoreProcedure
    • Stored Procedures
  • MVC
    • OverView
    • Evolution of MVC
    • Install VisualStudio-2015
    • Create First Application
  • LINQ
    • Introduction
  • Privacy Policy

Saturday, 13 May 2017

Types of CSS

  Unknown       22:22       CssOverview       No comments    

In this Tutorial Describe Types of CSS Basically we define 3 types of CSS see above-

  • Inline CSS
  • Internal (embedded) CSS
  • External CSS

Inline CSS -
In This CSS we add inline style.
Inline styles are styles that are written directly in the tag like div,textbox button etc. Inline styles affect only the tag they are applied to and not effect other tag untill unless not match same name and id of tag other wise apply both if match 2 tag's same name then.
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. See in Above Example-
Example Inline CSS
<!DOCTYPE html>
<html>
<body>
<div style="background-color:wheat;width:200px;height:50px;border:1px solid" >
</div>
</body>
</html>
Output-

Internal (embedded) CSS

Embeddded style are written on same page in head section we define all css properties and that is reflected only this page where we define internal css.
An internal style sheet should be used when a single document has a unique style. You
define internal styles in the head section by using the <stye type="text/css"> Select : Property
</style>
Example Internal CSS
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.inlinecss {
background-color:wheat;
width:300px;
height: 50px;
border:1px solid;
}
</style>

</head>
<body>
<div class="inlinecss">
</div>
</body>
</html>
Output-

The browser will now read the style definitions, and format the document according to it.
Note: A browser normally ignores unknown tags. This means that an old browser that
does not support styles, will ignore the <style> tag, but the content of the <style> tag will
be displayed on the page. It is possible to prevent an old browser from displaying the
content by hiding it in the HTML comment element:
<head>
<style type="text/css">
<!--
hr {color: sienna}
p {margin-left: 20px}
body {background-image: url("images/back40.gif")}
-->
</style>
</head>

External CSS

External styles are styles that are written in a separate document and then attached to various Web documents. External style sheets can affect any document they are attached to.We add external style sheet then attach on each page you want to attach and reflect those page. Use external sheet then no need internal and inline css and want common for whole site. This is easy to maintain for website.
An external style sheet is ideal when the style is applied to many pages. With an external
style sheet, you can change the look of an entire Web site by changing one file. Each page

Example
<link rel="stylesheet" type="text/css" href="styles.css" />
Note-> In this Styles.css file we write all styles in styles.css file. Give link on page where we want.

The browser will read the style definitions from the file styles.css, and format the
document according to it.You can write css style whatever you write all styles in this file.
An external style sheet can be written in any text editor. The file should not contain any
html tags. Your style sheet should be saved with a .css extension. An example of a style
sheet file is shown below:

hr {color: sienna}
p {margin-left: 20px}
body {background-color:blue;}

Note - Do NOT leave spaces between the property value and the units! If you use "marginleft:
20 px" instead of "margin-left: 20px" it will only work properly in IE6 but it will not
work in Mozilla/Firefox or Netscape.

Multiple Style Sheets 

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.
For example, an external style sheet has these properties for the h3 selector:
 h3 {
color: red; text-align: left; font-size: 8pt;
}
 And an internal style sheet has these properties for the h3 selector:
 h3
{
text-align: right; font-size: 20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be: 
color: red; text-align: right; font-size: 20pt
The color is inherited from the external style sheet and the text-alignment and the fontsize is replaced by the internal style sheet.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Email This BlogThis! Share to X Share to Facebook
Newer Post Older Post Home

0 comments :

Post a Comment

learningmvctutorial

Popular Posts

  • Overview
      SQL (Structured Query Language)   SQL  is a language that interacts with the database on the server-side. This dynamite duo has changed ...
  • SQL Select
    The SQL SELECT Statement The SELECT statement is used to select data from a database. SQL SELECT Syntax SELECT column_name , column_n...
  • Overview of HTML
    What is HTML? First developed by Tim Berners-Lee in 1990 . HTML is used to create electronic documents (called pages) that are displ...
  • Difference Between function v/s store procedure
    Definition  of Store Procedure In a database management system (DBMS), a  stored procedure  is a set of Structured Query Language (SQL...
  • Create Duplicate Table of existing table in SQL Server
    In This Tutorial we create table and want to same structure and same data then We create new table with data type after that  insert in ta...
  • What is Function in Sql Server
    A function is a block of code that has a name and it has a property that it is reusable. We use function in store Procedure and queries in...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • SQL Group By Clause
    What is Group By clause ? In this Article Group by clause use in Select query in Sql Server when you fetch data with collection on b...
  • About Javascript
    What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting langua...
  • Operator in JavaScript
    What is an operator? JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binar...

Blog Archive

  • ▼  2017 ( 35 )
    • ►  November ( 1 )
    • ►  October ( 2 )
    • ►  September ( 4 )
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ▼  May ( 3 )
      • CSS Selectors
      • Types of CSS
      • Ordered and Unordered list in Html
    • ►  April ( 7 )
    • ►  March ( 13 )
    • ►  February ( 3 )
Powered by Blogger.

Categories

  • AdvanceQuery
  • CreateApplication
  • CreateDb
  • CssOverview
  • Evolution
  • Formatting
  • Function
  • FunctionVSSp
  • HtmlOverview
  • InstallVisualStudio
  • Introduction
  • javascriptOverview
  • JsValidation
  • Mvc-vs-Asp.Net
  • OverView
  • Select
  • SqlCommand
  • SQLOverview
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © MVC | Powered by Blogger
Design by Vibha Acharya