Showing posts with label Text decoration. Show all posts
Showing posts with label Text decoration. Show all posts

Thursday 5 December 2013

CSS : FONT SIZE


Font Size

The font-size property sets the size of the text.
Being able to manage the text size is important in web design. However, you should not use font size adjustments to make paragraphs look like headings, or headings look like paragraphs.
Always use the proper HTML tags, like <h1> - <h6> for headings and <p> for paragraphs.
The font-size value can be an absolute, or relative size.
Absolute size:
  • Sets the text to a specified size
  • Does not allow a user to change the text size in all browsers (bad for accessibility reasons)
  • Absolute size is useful when the physical size of the output is known
Relative size:
  • Sets the size relative to surrounding elements
  • Allows a user to change the text size in browsers
* If you do not specify a font size, the default size for normal text, like paragraphs, is 16px (16px=1em).


Set Font Size With Pixels

Setting the text size with pixels gives you full control over the text size:

Example

h1 {font-size:40px;}
h2 {font-size:30px;}
p {font-size:14px;}

The example above allows Internet Explorer 9, Firefox, Chrome, Opera, and Safari to resize the text.
Note: The example above does not work in IE, prior version 9.
The text can be resized in all browsers using the zoom tool (however, this resizes the entire page, not just the text).

Set Font Size With Em

To avoid the resizing problem with older versions of Internet Explorer, many developers use em instead of pixels.
The em size unit is recommended by the W3C.
1em is equal to the current font size. The default text size in browsers is 16px. So, the default size of 1em is 16px.
The size can be calculated from pixels to em using this formula: pixels/16=em


Example

h1 {font-size:2.5em;} /* 40px/16=2.5em */
h2 {font-size:1.875em;} /* 30px/16=1.875em */
p {font-size:0.875em;} /* 14px/16=0.875em */

In the example above, the text size in em is the same as the previous example in pixels. However, with the em size, it is possible to adjust the text size in all browsers.
Unfortunately, there is still a problem with older versions of IE. The text becomes larger than it should when made larger, and smaller than it should when made smaller.

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:


Example

CSS : FONT PROPERTIES


All CSS Font Properties

Property
Description
font
Sets all the font properties in one declaration
font-family
Specifies the font family for text
font-size
Specifies the font size of text
font-style
Specifies the font style for text
font-variant
Specifies whether or not a text should be displayed in a small-caps font
font-weight
Specifies the weight of a font

CSS : TEXT DECORATION


Text Decoration
The text-decoration property is mostly used to remove underlines from links:


Example





CSS : STYLING LINKS


Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
Special for links are that they can be styled differently depending on what state they are in.
The four links states are:
  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Example

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

When setting the style for several link states, there are some order rules:
  • a:hover MUST come after a:link and a:visited
  • a:active MUST come after a:hover
 
 
 
 
 

CSS : BACKGROUND COLOR



Background Color

The background-color property specifies the background color for links:

Example

a:link {background-color:#B2FF99;}
a:visited {background-color:#FFFF85;}
a:hover {background-color:#FF704D;}
a:active {background-color:#FF704D;}

CSS : LIST


List

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.


Different List Item Markers

The type of list item marker is specified with the list-style-type property:


Example

ul.a {list-style-type: circle;}
ul.b {list-style-type: square;}

ol.c {list-style-type: upper-roman;}
ol.d {list-style-type: lower-alpha;}

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...