Tuesday 8 July 2014

CSS(Cascading Style Sheet) Design With ASP .Net (Part 1)

Introducing CSS:-

The introduction of CSS to the web development and design world brought it back to a clean and elegant solution for styling
Web pages. CSS ment a style couldbe defined in a single location for the entire Web site, and simply refernced on the elements
requiring the style.

Creating Style Sheet:-

The Style sheet can be included in the server's response in three different ways:
  • External Style Sheet
  • Internal Style Sheet
  • Inline Style Sheet

External Style Sheets:-

External Style Sheet are collections of CSS styles stored outside of the Web Pages that will use them- generally files using the .css extension. Visual studio makes it simple to add external style sheet files to your application by including a style sheet file templates in the Add New Item dialog box as show in image below:
 Visual Studio even gives you CSS Intellisense when working with styles in the document as shown in image below:

 External Style Sheets are linked into Web pages using HTML <link> tag. A single Web page can contain multiple style sheet references.

 
Using External Style Sheet in Web page.

Internal Style Sheets:-

Internal Style sheets are collection of CSS styles that are stored internally in a single web page. The styles are located inside of the HTML <style> tag, which is generally located in the <head> section of the Web page. Visual Studio also give Intellisense support to make it easy to add properties. An example of internal style is shown below:


Using Internal Style Sheets in a Web Page.

Inline Styles:-

Inline styles are CSS styles that are applied directly to an individual HTML element using the element's Stule attribute which is available on most HTML elements. An example of inline styles is shown below:

Using Inline styles in a Web page.

No comments:

Post a Comment