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

Tuesday, 21 March 2017

Overview of CSS

  Unknown       02:09       CssOverview       No comments    

What is CSS?

CSS stands for Cascading Style Sheets

CSS is used to describe the look and formatting of a document written in markup language. It provides an additional feature to HTML. It is generally used with HTML to change the style of web pages and user interfaces. It can also be used with any kind of XML documents including plain XML, SVG and XUL. CSS is used along with HTML and JavaScript in most websites to create user interfaces for web applications and user interfaces for many mobile applications.

CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.

  • Styles define how to display HTML elements
  • Styles are normally stored in Style Sheets
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save you a lot of work
  • External Style Sheets are stored in CSS files
  • Multiple style definitions will cascade into one

CSS Example
body { background-color:white; }

h1 { color:seagreen; text-align:left; }

p { font-family:"Arial"; font-size:15px; }


Styles Solve a Common Problem

HTML tags were originally designed to define the content of a document. They were supposed to say "This is a header", "This is a paragraph", "This is a table", by using tags like <h1 > , <p > , <table > , and so on. The layout of the document was supposed to be taken care of by the browser, without using any formatting tags. As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the <font < tag and the color attribute) to the original HTML specification, it became more and more difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout.

Multiple Styles Will Cascade Into One
Style sheets allow style information to be specified in many ways. Styles can be specified
inside a single HTML element, inside the <head> element of an HTML page, or in an
external CSS file. Even multiple external style sheets can be referenced inside a single
HTML document.

Cascading Order
What style will be used when there is more than one style specified for an HTML
element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style
sheet by the following rules, where number four has the highest priority:
1. Browser default
2. External style sheet
3. Internal style sheet (inside the <head> tag)
4. Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it
will override a style declared inside the <head> tag, in an external style sheet, or in a
browser (a default value).

Grouping
You can group selectors. Separate each selector with a comma. In the example below we
have grouped all the header elements. All header elements will be displayed in blue text
color. You can grouping any tag of multiple like div, p, apply any element.in this example you can see only header.
h1,h2,h3,h4,h5,h6
{
color: blue;
}

 The class Selector

With the class selector you can define different styles for the same type of HTML element.
Say that you would like to have two types of paragraphs in your document: one rightaligned paragraph, and one center-aligned paragraph. Here is how you can do it with styles:
  p.right {
    text-align: right
  }
  p.center {
   text-align: center
  }
You have to use the class attribute in your HTML document:
<p class="right">
This paragraph will be right-aligned.
</p>
<p class="center">
This paragraph will be center-aligned.
</p>


Note: To apply more than one class per given element, the syntax is:
<p class="center bold">
   This is a paragraph.
</p>

The paragraph above will be styled by the class "center" AND the class "bold". You can also omit the tag name in the selector to define a style that will be used by all HTML elements that have a certain class. In the example below, all HTML elements with class="center" will be center-aligned:

.center {
text-align: center
}
In the code below both the h1 element and the p element have class="center". This means that both elements will follow the rules in the ".center" selector:
 <h1 class="center">
  This heading will be center-aligned
 </h1>
 <p class="center">
  This paragraph will also be center-aligned.
 </p>

Note-Do NOT start a class name with a number! It will not work in Mozilla/Firefox.

Add Styles to Elements with Particular Attributes

You can also apply styles to HTML elements with particular attributes.
The style rule below will match all input elements that have a type attribute with a value
of "text":
  input[type="text"] {
    background-color: blue
   }

The id Selector

You can also define styles for HTML elements with the id selector. The id selector is
defined as a #.
The style rule below will match the element that has an id attribute with a value of
"green":
#green {color: green}
The style rule below will match the p element that has an id with a value of "para1":
p#para1
{
text-align: center;
color: gray;
}
Note : Do NOT start an ID name with a number! It will not work in Mozilla/Firefox.

CSS Comments

Comments are used to explain your code, and may help you when you edit the source
code at a later date. A comment will be ignored by browsers. A CSS comment begins with
"/*", and ends with "*/", like this:
/* This is a commented line */
p
{
text-align: center;
/* This is another comment  line margin:3px*/
color: blue;
font-family: arial;
}
In thi Commented line and assign margin:3px css style ignored by browser because this line is commented
  • 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 ...
  • 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...
  • 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...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • 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...
  • 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...
  • 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...
  • Open Application in MVC
    We want to create application in MVC first of how we create first application Show Steps   as below-     STEP 1 .  Start Computer and  I...

Blog Archive

  • ▼  2017 ( 35 )
    • ►  November ( 1 )
    • ►  October ( 2 )
    • ►  September ( 4 )
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ►  May ( 3 )
    • ►  April ( 7 )
    • ▼  March ( 13 )
      • What Is Store Procedure
      • Create First Application in MVC
      • How To Install Visual Stdio Step by Step Process
      • Overview of CSS
      • Overview of HTML
      • What is LINQ
      • Overview
      • Difference Between function v/s store procedure
      • What is Function in Sql Server
      • How To Create DataBase & Table in SQL Server
      • SQL Select
      • Open Application in MVC
      • MVC OverView
    • ►  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