Monday, February 6, 2012

Lesson 5: Text

Formatting and adding style to text is a key issue for any web designer. In this lesson you will be introduced to the amazing opportunities CSS gives you to add layout to text. The following properties will be described:
  • text-indent
  • text-align
  • text-decoration
  • letter-spacing
  • text-transform
Text indention [text-indent]
The property text-indent allows you to add an elegant touch to text paragraphs by applying an indent to the first line of the paragraph. In the example below a 30px is applied to all text paragraphs marked with <p>:
       
        p {
               text-indent: 30px;
        }
       
       
·         Show example
Text alignment [text-align]
The CSS property text-align corresponds to the attribute align used in old versions of HTML. Text can either be aligned to the left, to the right or centred. In addition to this, the value justifywill stretch each line so that both the right and left margins are straight. You know this layout from for example newspapers and magazines.
In the example below the text in table headings <th> is aligned to the right while the table data<td> are centred. In addition, normal text paragraphs are justified:
       
        th {
               text-align: right;
        }

        td {
               text-align: center;
        }

        p {
               text-align: justify;
        }
       
       
·         Show example
Text decoration [text-decoration]
The property text-decoration makes it is possible to add different "decorations" or "effects" to text. For example, you can underline the text, have a line through or above the text, etc. In the following example, <h1> are underlined headlines, <h2> are headlines with a line above the text and <h3> are headlines with a line though the text.
       
        h1 {
               text-decorationunderline;
        }

        h2 {
               text-decorationoverline;
        }

        h3 {
               text-decorationline-through;
        }
       
       
·         Show example
Letter space [letter-spacing]
The spacing between text characters can be specified using the property letter-spacing. The value of the property is simply the desired width. For example, if you want a spacing of 3pxbetween the letters in a text paragraph <p> and 6px between letters in headlines <h1> the code below could be used.
       
        h1 {
               letter-spacing6px;
        }

        p {
               letter-spacing3px;
        }
       
       
·         Show example
Text transformation [text-transform]
The text-transform property controls the capitalization of a text. You can choose to capitalize, use uppercase or lowercase regardless of how the original text is looks in the HTML code.
An example could be the word "headline" which can be presented to the user as "HEADLINE" or "Headline". There are four possible values for text-transform:
capitalize
Capitalizes the first letter of each word. For example: "john doe" will be "John Doe".
uppercase
Converts all letters to uppercase. For example: "john doe" will be "JOHN DOE".
lowercase
Converts all letters to lowercase. For example: "JOHN DOE" will be "john doe".
none
No transformations - the text is presented as it appears in the HTML code.
As an example, we will use a list of names. The names are all marked with <li> (list-item). Let's say that we want names to be capitalized and headlines to be presented in uppercase letters.
Try to take a look at the HTML code for this example and you will see that the text actually is in lowercase.
       
        h1 {
               text-transformuppercase;
        }

        li {
               text-transformcapitalize;
        }
       
       
·         Show example
Summary
In the last three lessons you have already learned several CSS properties, but there is much more to CSS. In the next lesson we will take a look at links.

Lesson 4: Fonts

In this lesson you will learn about fonts and how they are applied using CSS. We will also look at how to work around the issue that specific fonts chosen for a website can only be seen if the font is installed on the PC used to access the website. The following CSS properties will be described:
  • font-family
  • font-style
  • font-variant
  • font-weight
  • font-size
  • font
Font family [font-family]
The property font-family is used to set a prioritized list of fonts to be used to display a given element or web page. If the first font on the list is not installed on the computer used to access the site, the next font on the list will be tried until a suitable font is found.
There are two types of names used to categorize fonts: family-names and generic families. The two terms are explained below.
Family-name
Examples of a family-name (often known as "font") can e.g. be "Arial", "Times New Roman" or "Tahoma".
Generic family
Generic families can best be described as groups of family-names with uniformed appearances. An example is sans-serif, which is a collection of fonts without "feet".
The difference can also be illustrated like this:












When you list fonts for your web site, you naturally start with the most preferred font followed by some alternative fonts. It is recommended to complete the list with a generic font family. That way at least the page will be shown using a font of the same family if none of the specified fonts are available.
An example of a prioritized list of fonts could look like this:
       
        h1 {font-family: arialverdana, sans-serif;}
        h2 {font-family: "Times New Roman", serif;}
       
       
·         Show example
Headlines marked with <h1> will be displayed using the font "Arial". If this font is not installed on the user's computer, "Verdana" will be used instead. If both these fonts are unavailable, a font from the sans-serif family will be used to show the headlines.
Notice how the font name "Times New Roman" contains spaces and therefore is listed using quotation marks.
Font style [font-style]
The property font-style defines the chosen font either in normal, italic or oblique. In the example below, all headlines marked with <h2> will be shown in italics.
       
        h1 {font-family: arialverdana, sans-serif;}
        h2 {font-family: "Times New Roman", serif; font-style: italic;}
       
       
·         Show example
Font variant [font-variant]
The property font-variant is used to choose between normal or small-caps variants of a font. Asmall-caps font is a font that uses smaller sized capitalized letters (upper case) instead of lower case letters. Confused? Take a look at these examples:



If font-variant is set to small-caps and no small-caps font is available the browser will most likely show the text in uppercase instead.
       
        h1 {font-variant: small-caps;}
        h2 {font-variant: normal;}
       
       
·         Show example
Font weight [font-weight]
The property font-weight describes how bold or "heavy" a font should be presented. A font can either be normal or bold. Some browsers even support the use of numbers between 100-900 (in hundreds) to describe the weight of a font.
       
        p {font-family: arialverdana, sans-serif;}
        td {font-family: arialverdana, sans-serif; font-weight: bold;}
       
       
·         Show example
Font size [font-size]
The size of a font is set by the property font-size.
There are many different units (e.g. pixels and percentages) to choose from to describe font sizes. In this tutorial we will focus on the most common and appropriate units. Examples include:
       
        h1 {font-size: 30px;}
        h2 {font-size: 12pt;}
        h3 {font-size: 120%;}
        p {font-size: 1em;}
       
       
·         Show example
There is one key difference between the four units above. The units 'px' and 'pt' make the font size absolute, while '%' and 'em' allow the user to adjust the font size as he/she see fit. Many users are disabled, elderly or simply suffer from poor vision or a monitor of bad quality. To make your website accessible for everybody, you should use adjustable units such as '%' or 'em'.
Below you can see an illustration of how to adjust the text size in Mozilla Firefox and Internet Explorer. Try it yourself - neat feature, don't you think?









Compiling [font]
Using the font short hand property it is possible to cover all the different font properties in one single property.
For example, imagine these four lines of code used to describe font-properties for <p>:
       
        p {
               font-style: italic;
               font-weight: bold;
               font-size: 30px;
               font-familyarial, sans-serif;
        }
       
       
Using the short hand property, the code can be simplified:
       
        p {
               font: italic bold 30px arial, sans-serif;
        }
       
       
The order of values for font is:
font-style | font-variant | font-weight | font-size | font-family
Summary
You have now learned about some of the possibilities related to fonts. Remember that one of the major advantages of using CSS to specify fonts is that at any given time, you can change font on an entire website in just a few minutes. CSS saves time and makes your life easier. In the next lesson we will look at text.

Wednesday, January 11, 2012

How to share an internet connection on LAN

If you have a fully functional LAN then net sharing is few click away, yes few clicks. I assumed that you have already a broadband connection and account configured on your PC. Just go to “My Network Places” properties, and then select your broadband connection. Now right click on it and select properties. Now broadband properties dialog box should be appear. Here select “Advanced” tab.

Broadband Connection properties selection.

Now check “Allow other network users to connect through this computer" internet connection” and uncheck below two options. Now press “OK” button. This will give you a message stating that IP address of present working PC will be set to “192.168.0.1”, click OK. If you assigned this address to any other computer then change it to something else otherwise it will give IP address conflict error.

Broadband Connection properties.

Now a hand like icon should appear below the broadband connection, indicating that it has been shared.

Broadband Connection after sucessful sharing.

Go to other PC, select “My Network Places” properties, and then select your LAN connection. Now right click on it and select properties. Now LAN properties dialog box should be appear. Here select “Internet Protocol (TCP/IP)” as did during IP address assignment. Now click properties button,” Internet Protocol (TCP/IP) properties” dialog should appear. Here you need to give the “Default Gateway” and “DNS Server” IP as shown in the image. Repeat this step on other PCs too.

Default gateway & DNS server IP assigning.

Connect the internet on server PC where internet connection is physically attached, then try to access internet on other PC. If you see the positive results then Congrats! Else;
Check LAN connection. If you can access Shared Folders then follow next step else you need to check internet sharing from beginning.

You need to check your internet connection again. Try this, press window key + R, now type this without quotes “ping www.google.com -t”. If you get reply as given in below image then net sharing is OK your internet browser corrupted or internet browser setting changed to use proxy address. Please off all proxy address. Now you should able to browse.

nternet connection ping result.





Related Posts Plugin for WordPress, Blogger...