Skip to main content

Cascading Style Sheets CSS

What is CSS?

Cascading style sheets is a markup language to define styles. This is mostly used in html but we can also use the same for any XML based markup languages.  It allows to adopt for different types of devises  like Desktop, large screen, small screen, iPad, mobile, printers etc.


Why we need CSS?


CSS mainly used for the following benefits.

  • It improves the readability of the base html/XML markup language
  • It is independent to the base markup language, hence it can be used again and again for the same page or more than one pages (it is reusable).
  • It is simple, no programming languages or complex algorithm is required.
  • Different devices can be defined in a single CSS. So the same CSS can be used for different devices.
  • It reduces the usages of JavaScript for some simple use cases. We cannot define style or attributes to html markup for event like mouse up, mouse over events.

How we apply CSS?


CSS can be apply to the a html/xml by using classes or styles. A select rule is used to apply the defined style to the markup language. The selector may be any one of the following with or with hierarchy and event selector

  • Tag selector - used by tag name (body, div, etc.,)
  • Id selector - used by id prefix with hash (#textbox1, #firstdiv, etc.,)
  • Class selector - used by class name prefix with dot (.nav, .color, etc.,)
  • Tag selector with attribute filter (input[name='firstname'])
  • hierarchy selector (body div .first-element ul li)

Comments

Post a Comment

Popular posts from this blog

How to post a dynamic form using json data?

// Post dynamic form using json data   function post(uri, data, method) { // when method not provided use default post method method = method || "post" ;     var form = document.createElement( "form" ); form.setAttribute( "method" , method); form.setAttribute( "action" , uri); for ( var property in data) {   if (params.hasOwnProperty(property)) {     var hiddenField = document.createElement( "input" );     hiddenField.setAttribute( "type" , "hidden" );     hiddenField.setAttribute( "name" , property);     hiddenField.setAttribute( "value" , data[property]);      form.appendChild(hiddenField);   } } document.body.appendChild(form); form.submit(); }

Mapping .NET Data Types to MySQL Data Types

Mapping .NET Data Types to MySQL Data Types .NET Data Types MySQL Data Types System.Boolean boolean, bit(1) System.Byte tinyint unsigned System.Byte[] binary, varbinary, blob, longblob System.DateTime datetime System.Decimal decimal System.Double double System.Guid char(36) System.Int16 smallint System.Int32 int System.Int64 bigint System.SByte tinyint System.Single float System.String char, varchar, text, longtext System.TimeSpan time DateTimeOffset type is not supported.

C# - How to get Property Name and Value of a dynamic object?

C# - Dynamic Object Use the following code to get Name and Value of a dynamic object's property. dynamic d = new { Property1= "Value1", Property2= "Value2"}; var properties = d.GetType().GetProperties(); foreach (var property in properties) {     var PropertyName= property.Name; //You get "Property1" as a result     var PropetyValue= d.GetType().GetProperty(property.Name).GetValue(d, null); //You get "Value1" as a result // you can use the PropertyName and Value here  }