Showing posts with label text indentation. Show all posts
Showing posts with label text indentation. Show all posts

Thursday, 5 December 2013

CSS : TEXT COLOR


 Text Color

The color property is used to set the color of the text.
With CSS, a color is most often specified by:
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

The default color for a page is defined in the body selector.

Example

CSS : TEXT ALIGNMENT


Text Alignment

The text-align property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

Example
h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}

CSS : TEXT DECORATION


Text Decoration

The text-decoration property is used to set or remove decorations from text.
The text-decoration property is mostly used to remove underlines from links for design purposes:

Example
a {text-decoration:none;}


It can also be used to decorate text:

Example




CSS : TEXT TRANSFORMATION


Text Transformation

The text-transform property is used to specify uppercase and lowercase letters in a text.
It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

Example

CSS : TEXT INDENTATION

CSS : list-SHORTAND PROPERTY


List - Shorthand property
It is also possible to specify all the list properties in one, single property. This is called a shorthand property.
The shorthand property used for lists, is the list-style property:


Example

ul
{
list-style: square url("sqpurple.gif");
}

When using the shorthand property, the order of the values are:
  • list-style-type
  • list-style-position (for a description, see the CSS properties table below)
  • list-style-image
It does not matter if one of the values above are missing, as long as the rest are in the specified order.




Other Topics

CSS : CROSSBROWSER SOLUTION


Crossbrowser Solution

The following example displays the image-marker equally in all browsers:


Example

ul
{
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul li
{
background-image: url(sqpurple.gif);
background-repeat: no-repeat;
background-position: 0px 5px; 
padding-left: 14px; 
}

Example explained:
  • For ul:
    • Set the list-style-type to none to remove the list item marker
    • Set both padding and margin to 0px (for cross-browser compatibility)
  • For all li in ul:
    • Set the URL of the image, and show it only once (no-repeat)
    • Position the image where you want it (left 0px and down 5px)
    • Position the text in the list with padding-left
 
 
 
 

CSS : IMAGE as THE LIST ITEM MARKER


An Image as The List Item Marker

To specify an image as the list item marker, use the list-style-image property:


Example

ul
{
list-style-image: url('sqpurple.gif');
}

The example above does not display equally in all browsers. IE and Opera will display the image-marker a little bit higher than Firefox, Chrome, and Safari.
If you want the image-marker to be placed equally in all browsers, a crossbrowser solution is explained below.

CSS : TABLE BORDERS


Table Borders

To specify table borders in CSS, use the border property.
The example below specifies a black border for table, th, and td elements:

Example

table, th, td
{
border: 1px solid black;
}

Notice that the table in the example above has double borders. This is because both the table and the th/td elements have separate borders.

Physics basic inventions and inventors

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