HTML 5 - Easier and faster

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Ubuntu - One of Linux Distribution

Ubuntu is a Linux distribution operating system software, meaning that it runs using Linux applications, kernels and libraries. Ubuntu is developed and sponsored by Canonical, Ltd., a South African company that is founded and funded by Mark Shuttleworth.

JavaScript Introduction

Ryan Paulin When dealing with website development, there is lots of scripting language that you can choose from depending on how you want to develop your website. You can use AJAX, HTML, CSS.

Acquainted with CSS ( What is CSS ? )

CSS stands for Cascading Style Sheets. If you read in the dictionary, cascading is similiar with waterfall. But in this case, it means the flow from one code to another code that are interconected. So it can be concluded, CSS is a collection of codes that are consecutive and interlinked to set the format / display an HTML page.

What is Linux ?

Linux – the operating system for a GNU (pronounced Gnew) generation. It has been dubbed the alternative to Microsoft, the solution to all life’s problems and many other things that may or may not be true. But what is Linux, and should you care?

Tampilkan postingan dengan label web design. Tampilkan semua postingan
Tampilkan postingan dengan label web design. Tampilkan semua postingan

Senin, 01 Agustus 2011

Acquainted with CSS ( What is CSS ? )

What is CSS ?

CSS stands for Cascading Style Sheets. If you read in the dictionary, cascading is similiar with waterfall. But in this case, it means the flow from one code to another code that are interconected. So it can be concluded, CSS is a collection of codes that are consecutive and interlinked to set the format / display an HTML page.


The advantages of using CSS

If you have several pages where you use arial font for writing, then one day you get bored with arial and want replace it with trebuchet, you have to change one by one at your page and change the font type from arial to trebuchet.

By using css, to change the look of many pages, you simply do it in one CSS document, without having to touch the HTML file.

Thus, the advantages of using CSS, more practical!

Disadvantages Using CSS

Although CSS make designing web page easier and faster, but still there is a shortage of css. Not all browsers interpret CSS code in the same way. So sometimes, the web interface with the CSS looks good in one browser, but the mess in other browsers. So you should check the display to look good in all browsers and add special codes specific browser if needed in order to display your website looks good in all browsers. Needed more training so that when you designing a website with CSS, it can showed properly in all browsers.

Syntax / The way to writing CSS

Syntax / CSS sentences composed of several sets of regulations that have: a selector, a property, a value.

The format of writing sentences CSS:
selector { property: value }
Selector to indicate which parts are going to set up / formatted.

Property to show which parts of the selectors who want to set.

Value is the value of its settings.

Example:
h1 { color: red }
The example below show :
Selector: h1

Property: color

Value: red
Or we can said like this : That css has the function to set the color from h1 tags to red.

Grouping the Selectors

You can write a CSS code for a variety of selectors by using a comma. Suppose you want to set the tag h1, h2 and h3 all use red, then the CSS code become like this :
h1,h2,h3 { color: red }
Consider writing h1, h2, h3, separated by commas.

Using Many Properties

To set more than one properties you can use separator semicolon (;).

example:
h1,h2,h3 {color:red; font-family:arial; font-size:150%;}
In the example above, tags h1, h2 and h3 are set to use red, with arial font type and font size to 150%.

How the Good Writting of CSS ?

It is advisable to write the CSS code using a few lines in which setting property and its values ​​in the indent. Yes, to be more organized and easier to read, not a necessity.
h1,h2,h3 {
color:red;
font-family:arial;
font-size:150%;
}
Now that you understand the basic rules of writing sentences CSS. The next post will teach you apply the CSS code to your pages.

CSS Comment

Sometimes, it helps you write comments in your CSS code to give a reminder note.

You can use the syntax /* for the opening tags and * / as clossing tags to write a comment. Any text that is between the tag / * and * / will not be read as a code, but only as a record for yourself.
/* Write your comment here */
p
{
text-align: justify;
/* Write your comment here */
color: blue;
font-family: arial;
}
Inputing CSS to Web Document

There are three ways to inputing CSS to your web document. What are they ? Let me explain it one by one. Check this out :
  1. External style sheet
    An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. It consume less time and powe. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
    <head>
    <link rel="stylesheet" type="text/css" href="mystyle.css" />
    </head>
    An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. And you can put that .css files anywhere you want. But, be sure to call the right place in your html files. For a better result, it's recommanded to use full path instead of simple path. An example of a style sheet file is shown below:
    hr {color:sienna;}
    p {margin-left:20px;}
    body {background-image:url("images/back40.gif");}
  2. Internal style sheet
    An internal style sheet should be used when a single document has a unique style. You can do this, if don't make many changes to your html files. Or you will get confused to edit it later. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
    <head>
    <style type="text/css">
    hr {color:sienna;}
    p {margin-left:20px;}
    body {background-image:url("images/back40.gif");}
    </style>
    </head>
  3. Inline Styles
    An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly! To use inline styles you use the style attribute in the relevant tag. For your information, this style rarely use in web developing. Because when you want to edit it, yeah you must find the css and also take a look at the thml tags. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
    <p style="color:sienna;margin-left:20px">This is a paragraph.</p>
  4. Multiple Style Sheets
    If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.For example, an external style sheet has these properties for the h3 selector:
    h3
    {
    color:red;
    text-align:left;
    font-size:8pt;
    }
    And an internal style sheet has these properties for the h3 selector:
    h3
    {
    text-align:right;
    font-size:20pt;
    }
    If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
    color:red;
    text-align:right;
    font-size:20pt;
    The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.
  5. Multiple Styles Will Cascade into One
    Styles can be specified:
    • inside an HTML element
    • inside the head section of an HTML page
    • in an external CSS file
    Tip: Even multiple external style sheets can be referenced inside a single HTML document.
Cascading order

What style will be used when there is more than one style specified for an HTML element?

Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
  1. Browser default
  2. External style sheet
  3. Internal style sheet (in the head section)
  4. Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

Oke, i think that's all i want to introduce you about CSS. There some word i copy from w3school. Next posting, we will try to make a dropdown menu with css. Interesting? Let's wait until next post. :)

At last, Happy Coding All :)

Installing XAMPP on Linux

To install Xampp on windows, is not a difficult thing in fact. We just follow the instruction, wait a while, and XAMPP was ready to use. However, in linux we encounter something slightly different. Maybe this tutorial for some people is easy, but for the needy, but if you having trouble to install XAMPP in your Linux, follow this instruction.

Note : In this tutorial I use Xampp for Linux version 1.7.4

Well, without much talking let's start installing Xampp on linux. :)

  1. First, download the linux version of xampp on their official website, click here to download xampp for linux version 1.7.4.
  2. Put the downloaded files .tar.gz on the desktop if it is not automatically saved on the desktop.
  3. Open a terminal (Applications> Accessories> Terminal).
  4. Go to where you store the downloaded xampp for linux earlier. (I assume you save it on your desktop, if you do not please go to the place you store it.
    cd desktop
  5. Login as super admin. (On some Linux distributions such as Ubuntu 10 you do not need to log in as super admin. You just add sudo at the beginning of each command.)
    sudo -s
  6. Enter the password if requested.
  7. Extract the downloaded files into the folder / opt.
    tar xvfz xampp-linux-1.7.4.tar.gz -C /opt
    For users of Ubuntu version 10 and above, including me:) type the following command.
    sudo tar xvfz xampp-linux-1.7.4.tar.gz -C /opt
    The above command will be extract xampp into the folder / opt / lampp.
  8. Now, we try to run the xampp with the command.
    /opt/lampp/lampp start
    or try with this command.
    sudo /opt/lampp/lampp start
  9. After the XAMPP running, open a browser and go to localhost (http://localhost) If all goes well, then we will get a language selection page of XAMPP.
  10. After selecting your language, we will automatically go to the welcome page.
  11. Now we go to the security page by clicking Security on the left menu. You will get "unsecured" status in all lists.

    If you will use XAMPP for local activities or just on a personal computer, this should not be a big problem. But, it helps us to practice to make Xampp "more secure".

    Next, let us make our XAMPP more secure.

  12. Type the following code at the terminal.
    /opt/lampp/lampp security
    Or like this if error message appeared.
    sudo /opt/lampp/lampp security
    Note : Make sure you are logged in as super admin.
  13. Type "yes" or "y" when asked to set a password and enter the password you want twice.
  14. After that, type "yes" or "y" when you are asked if you do not want MySql accessed through network. This option is optional. If you choose yes, then it will restart mysql. Please wait a moment.
  15. Then, you will be prompted to set passwords for PhpMyAdmin. Do as the previous step.
  16. And again, you will be prompted to set the password for user "root" in MySQL. Make sure the password was easy to remember, or if you forgot, this things will become a big problem. :)
  17. The next is to set a password for ftp. You could set no to this option, but it's better to keep it set even though it was not going to use latter. With this, then xampp security setting will be completed
  18. To ensure everything goes smoothly, we returned to the browser and go to localhost (http://localhost)
    You will be asked to enter a username and password.
    Enter username: lampp.
    Enter password: (as you were setting it before)
  19. After the welcome page opens, go to page security. You will see the status of each list to be "secured".
Okay at this stage, the installation of XAMPP on Linux is complete.
Next we will set the htdocs folder for easy in its use later when creating websites. From my experience, when i try to put my website folder in htdocs folder, and try to access it from browser, i got an error said that "Files not found". Well, i try this one to fix it.

Follow this step :

  1. Open a terminal and type the following command.
    mkdir ~/public_html
    Or you can easily right-click on the home, create a new folder and name it "public_html" without quotes of his.
  2. Now we create a link from public_html folder to folder / opt / lampp / htdocs. Please open a terminal and type the following command.
    sudo ln -s ~/public_html /opt/lampp/htdocs/
  3. To set the "user permissions" for the htdocs folder, reopen the terminal, then log in as super admin and typing the following command.
    chown yourusername -R /opt/lampp/htdocs
    or :
    sudo chown yourusername -R /opt/lampp/htdocs
    This command will change the owner or ownership of the original htdocs folder owner to yourusername.
    Command -R means recursive, where the htdocs folder and files and folders inside it will also be replaced its ownership.
Okay, that is it. Our XAMPP is ready to be used to design or developed website. :)
However, when we restart the computer, then we should re-open the terminal, and type the command.
sudo /opt/lampp/lampp start
If you want to run XAMPP automatically each time you boot your system, then follow these steps:
  1. Click the menu system > preferences > Startup Applications.
  2. After the Application Startup window opens, click add.
  3. Then enter this command :
    Name = Xampp
    Command = /opt/lampp/lampp start
That is it, every time you boot, xampp will automatically run.

If you want a Graphic User Interface (GUI) to run and stop XAMPP, follow these steps:
  1. Open the terminal and type :
    gksudo gedit
  2. Copy dan paste this code on your gedit.
    [Desktop Entry]
    Comment=Start and Stop XAMPP
    Name=XAMPP Control Panel
    Exec=gksudo python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py
    Icon[en_CA]=/usr/share/icons/Humanity/devices/24/network-wired.svg
    Encoding=UTF-8
    Terminal=false
    Name[en_CA]=XAMPP Control Panel
    Comment[en_CA]=Start and Stop XAMPP
    Type=Application
    Icon=/usr/share/icons/Humanity/devices/24/network-wired.svg
  3. After that, save in "/home/usr/share/applications" and set the name "xampp-control-panel.desktop" to the files
  4. Now, XAMPP Control Panel will appeared at menu Applications > other.
    Clik it, and you will get a window like this one :
Okay, that's it. Congratulations and do usefull thing. :)

If there any mistake on this post, please correct me because i'm still learn.

At last, Happy Codding All. :)

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More