Category: CSS

fixed layout example

When we define layout of an html document to be fixed, the size and position of the html components will stay same even if we decrease the size of web page. In other words, the html page will not be responsive. In fixed layout, we assign widths using pixel units. The following is a complete

assigning multiple css classes to an object

It is also possible to assign multiple css classes to a single html object. ┬áIn that case, the names of the css classes will be written in “class” property of html object with spaces. In the following example, the second paragraph tag P is assigned with two classes, the myclass2 is changing the color of

creating separate css file

It is preferable to put all the css related code and classes in a separate file, and include that file in the html document in which we want to apply properties of those class. The following is code of a style sheet: stylesheet.css @charset "utf-8"; /* CSS Document */ .note { font-family:Verdana, Geneva, sans-serif; color:#06C;

assigning css style to all html objects

In CSS, wild card * can also be used to apply the property of class to all the objects in the document. In the following example, the properties defined in * are applied to all the objects <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> * { color:#00F; } </style> </head> <body> <h1>

Cascaded Style Sheets

Cascaded Style Sheets are used to set the layout of html objects. Various design related properties are grouped in css “classes”. There are various methods to define a class. If a class name is same to an html object, then the properties defined in the class are automatically applied to all the html objects with