Minggu, 02 Juni 2013

JAVA SCRIPT

       Merupakan bahasa script yang populer di internet java Script dapat disisipkan di halaman web menggunakan tag "<script></script>" . Java Script pertama kali dikembangkan oleh Brendan Eich dari Netscape dengan nama Mocha selanjutnya berganti menjadi Live Script dan akhirnya menjadi Java Script. File Java Script yang dipakai secara eksternal disimpan dengan ekstensi ".js" hal ini berguna jika java script akan digunakan beberapa kali dibeberapa halaman.
      Java Script dapat ditempatkan di head, body maupun Eksternal  berikut cara penulisannya :

1. Java Script di head
<html>
     <head>
        <script type="text/javascript">.....
         </script>
     </head>
     <body>
    </body>
</html>
2. Java Script di body
<html>
    <head>
    </head>
    <body>
        <script type="text/javascript">......
        </script>
    </body>
</html>
3. Java Script External
<html>
   <head>
   </head>
        <script src="javascript.js">
        </script>
   <body>
  </body>
</html>
Penulisan Java Script sangatlah sensitif sehingga huruf kecil ataupun besar harus diperhatikan karena akan mempengaruhi hasil yang akan ditampilkannya.
Berikut kelebihan dan Kekurangan dari java script :
Kelebihan

  • lebih praktis dan mudah karena memiliki sedikit sintaks daripada css
  • Koneksi lebih cepat karena ukuran lebih kecil dan dapat langsung dijalankan di browser
Kekurangan
  • Pengelolaan objek dalam javascript sangat terbatas
  • Script dapat dengan mudah di-copy paste sehingga kurang menghargai kerja keras orang lain.
Namun secara keseluruhan Java script sangatlah berguna karena dengan adanya java script akan lebih dinamis dan interaktif terhadap user karena halaman web sudah dapat menjadi program aplikasi yang memproses permintaan yang diberikan sehingga user tidak harus mendownload terlebih dahulu dari server namun dapat dilalukan sendiri oleh javascript pada browser.

Senin, 13 Mei 2013

CSS (Cascading Style Sheets)


Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL.
CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the layout, colors, and fonts.[1] This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content (such as by allowing for tableless web design). CSS can also allow the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser or screen reader) and on Braille-based, tactiledevices. It can also be used to allow the web page to display differently depending on the screen size or device on which it is being viewed. While the author of a document typically links that document to a CSS style sheet, readers can use a different style sheet, perhaps one on their own computer, to override the one the author has specified.
CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. In this so-calledcascade, priorities or weights are calculated and assigned to rules, so that the results are predictable.
The CSS specifications are maintained by the World Wide Web Consortium (W3C). Internet media type (MIME type) text/css is registered for use with CSS by RFC 2318 (March 1998), and they also operate a free CSS validation service.
Selector 
In CSS, selectors are used to declare which part of the markup a style applies to, a kind of match expression. Selectors may apply to:
  • all elements of a specific type, e.g. the second level headers h2
  • to elements specified by attribute, in particular:
    • id: an identifier unique to the document
    • class
  • to elements depending on how they are placed relative to, or nested within, others in the document tree.
Pseudo-classes are used in CSS selectors to permit formatting based on information that is outside the document tree. An often-used example of a pseudo-class is :hover, which identifies content only when the user 'points to' the visible element, usually by holding the mouse cursor over it. It is appended to a selector as in a:hover or #elementid:hover. A pseudo-class classifies document elements, such as :link or :visited, whereas a pseudo-element makes a selection that may consist of partial elements, such as :first-line or :first-letter.
Use
Prior to CSS, nearly all of the presentational attributes of HTML documents were contained within the HTML markup; all font colors, background styles, element alignments, borders and sizes had to be explicitly described, often repeatedly, within the HTML. CSS allows authors to move much of that information to another file, the style sheet, resulting in considerably simpler HTML.
Headings (h1 elements), sub-headings (h2), sub-sub-headings (h3), etc., are defined structurally using HTML. In print and on the screen, choice of font, size, color and emphasis for these elements is presentational.
Prior to CSS, document authors who wanted to assign such typographic characteristics to, say, all h2 headings had to repeat HTML presentational markup for each occurrence of that heading type. This made documents more complex, larger, and more difficult to maintain. CSS allows the separation of presentation from structure. CSS can define color, font, text alignment, size, borders, spacing, layout and many other typographic characteristics, and can do so independently for on-screen and printed views. CSS also defines non-visual styles such as the speed and emphasis with which text is read out by aural text readers. The W3C has now deprecated the use of all presentational HTML markup.[citation needed]
An "external" CSS stylesheet file, as described below, can be associated with an HTML document using the following syntax:

<link href="path/to/file.css" rel="stylesheet">


Limitations 
Some noted limitations of the current capabilities of CSS include:
Selectors are unable to ascend
CSS offers no way to select a parent or ancestor of an element that satisfies certain criteria, until CSS Selectors Level 4, which is still in Working Draft status. A more advanced selector scheme (such as XPath) would enable more sophisticated style sheets. However, the major reasons for the CSS Working Group previously rejecting proposals for parent selectors are related to browser performance and incremental rendering issues.
Vertical control limitations 
While horizontal placement of elements is generally easy to control, vertical placement is frequently unintuitive, convoluted, or outright impossible. Simple tasks, such as centering an element vertically or getting a footer to be placed no higher than bottom of viewport, either require complicated and unintuitive style rules, or simple but widely unsupported rules.
Absence of expressions 
There is currently no ability to specify property values as simple expressions (such as margin-left: 10% – 3em + 4px;). This would be useful in a variety of cases, such as calculating the size of columns subject to a constraint on the sum of all columns. However, a working draft with a calc() value to address this limitation has been published by the CSS WG.Internet Explorer versions 5 to 7 support a proprietary expression() statement, with similar functionality. This proprietary expression() statement is no longer supported from Internet Explorer 8 onwards, except in compatibility modes. This decision was taken for "standards compliance, browser performance, and security reasons".
Lack of column declaration 
While possible in current CSS 3 (using the column-count module), layouts with multiple columns can be complex to implement in CSS 2.1. With CSS 2.1, the process is often done using floating elements, which are often rendered differently by different browsers, different computer screen shapes, and different screen ratios set on standard monitors.
Cannot explicitly declare new scope independently of position 
Scoping rules for properties such as z-index look for the closest parent element with a position:absolute or position:relative attribute. This odd coupling has undesired effects. For example, it is impossible to avoid declaring a new scope when one is forced to adjust an element's position, preventing one from using the desired scope of a parent element.
Pseudo-class dynamic behavior not controllable 
CSS implements pseudo-classes that allow a degree of user feedback by conditional application of alternate styles. One CSS pseudo-class, ":hover", is dynamic (equivalent of JavaScript "onmouseover") and has potential for abuse (e.g., implementing cursor-proximity popups), but CSS has no ability for a client to disable it (no "disable"-like property) or limit its effects (no "nochange"-like values for each property).
Cannot name rules 
There is no way to name a CSS rule, which would allow (for example) client-side scripts to refer to the rule even if its selector changes.
Cannot include styles from a rule into another rule 
CSS styles often must be duplicated in several rules to achieve a desired effect, causing additional maintenance and requiring more thorough testing.
Cannot target specific text without altering markup 
Besides the :first-letter pseudo-element, one cannot target specific ranges of text without needing to utilize place-holder elements.
Advantages 
Separation of content from presentation
CSS facilitates publication of content in multiple presentation formats based on nominal parameters. Nominal parameters include explicit user preferences, different web browsers, the type of device being used to view the content (a desktop computer or mobile Internet device), the geographic location of the user and many other variables.
Site-wide consistency
When CSS is used effectively, in terms of inheritance and "cascading," a global style sheet can be used to affect and style elements site-wide. If the situation arises that the styling of the elements should need to be changed or adjusted, these changes can be made by editing rules in the global style sheet. Before CSS, this sort of maintenance was more difficult, expensive and time-consuming.
Bandwidth
A stylesheet, internal or external, will specify the style once for a range of HTML elements selected by class, type or relationship to others. This is much more efficient than repeating style information inline for each occurrence of the element. An external stylesheet is usually stored in the browser cache, and can therefore be used on multiple pages without being reloaded, further reducing data transfer over a network.
Page reformatting
Main article: Progressive enhancement
With a simple change of one line, a different style sheet can be used for the same page. This has advantages for accessibility, as well as providing the ability to tailor a page or site to different target devices. Furthermore, devices not able to understand the styling still display the content.
Accessibility
Without CSS, web designers must typically lay out their pages with techniques that hinder accessibility for vision-impaired users, like HTML tables (see Tableless web design#Accessibility).

XHTML


XHTML (Extensible HyperText Markup Language) is a family of XML markup languages that mirror or extend versions of the widely usedHypertext Markup Language (HTML), the language in which web pages are written.
While HTML (prior to HTML5) was defined as an application of Standard Generalized Markup Language (SGML), a very flexible markup language framework, XHTML is an application of XML, a more restrictive subset of SGML. Because XHTML documents need to be well-formed, they can be parsed using standard XML parsers—unlike HTML, which requires a lenient HTML-specific parser.
XHTML 1.0 became a World Wide Web Consortium (W3C) Recommendation on January 26, 2000. XHTML 1.1 became a W3C Recommendation on May 31, 2001. XHTML5 is undergoing development as of September 2009, as part of the HTML5 specification.
XHTML was developed to make HTML more extensible and increase interoperability with other data formats. HTML 4 was ostensibly an application of Standard Generalized Markup Language(SGML); however the specification for SGML was complex, and neither web browsers nor the HTML 4 Recommendation were fully conformant to it. The XML standard, approved in 1998, provided a simpler data format closer in simplicity to HTML 4. By shifting to an XML format, it was hoped HTML would become compatible with common XML tools; servers and proxies would be able to transform content, as necessary, for constrained devices such as mobile phones. By utilizing namespaces, XHTML documents could provide extensibility by including fragments from other XML-based languages such as Scalable Vector Graphics and MathML. Finally, the renewed work would provide an opportunity to divide HTML into reusable components (XHTML Modularization) and clean up untidy parts of the language.
There are various differences between XHTML and HTML. The Document Object Model is a tree structure that represents the page internally in applications, and XHTML and HTML are two different ways of representing that in markup (serializations). Both are less expressive than the DOM (for example, "--" may be placed in comments in the DOM, but cannot be represented in a comment in either XHTML or HTML), and generally XHTML's XML syntax is a little more expressive than HTML (for example, arbitrary namespaces are not allowed in HTML). So, firstly one source of differences is immediate: XHTML uses an XML syntax, while HTML uses a pseudo-SGML syntax (officially SGML for HTML 4 and under, but never in practice, and standardised away from SGML in HTML5). Secondly however, because the expressible contents of the DOM in syntax are slightly different, there are some changes in actual behavior between the two models.
First, there are some differences in syntax:
·         Broadly, the XML rules require that all elements be closed, either by a separate closing tag or using self-closing syntax (e.g. <br />), while HTML syntax permits some elements to be unclosed because either they are always empty (e.g. <input>) or their end can be determined implicitly ("omissibility", e.g. <p>).
·         XML is case-sensitive for element and attribute names, while HTML is not.
·         Some shorthand features in HTML are omitted in XML, such as (1) attribute minimization, where attribute values or their quotes may be omitted (e.g. <option selected> or <option selected=selected>, while XML this must be expressed as <option selected="selected">); (2) element minimization may be used to remove elements entirely (such as<tbody> inferred in a table if not given); and (3) the rarely used SGML syntax for element minimization ("shorttag"), which most browsers do not implement.
·         There are numerous other technical requirements surrounding namespaces and precise parsing of whitespace and certain characters and elements. The exact parsing of HTML in practice has been undefined until recently; see the HTML5 specification ([HTML5]) for full details, or the working summary (HTML vs. XHTML).
Secondly, in contrast to these minor syntactical differences, there are some behavioral differences, mostly arising from the underlying differences in serialization. For example:
·         Most prominently, behavior on parse errors differ. A fatal parse error in XML (such as an incorrect tag structure) causes document processing to be aborted.
·         Most content requiring namespaces will not work in HTML, except the built-in support for SVG and MathML in the HTML5 parser along with certain magic prefixes such as xlink.
·         JavaScript processing is a little different in XHTML, with minor changes in case sensitivity to some functions, and further precautions to restrict processing to well-formed content. Scripts must not use the document.write() method; it is not available for XHTML. The innerHTML property is available, but will not insert non-well-formed content. On the other hand, it can be used to insert well-formed namespaced content into XHTML.
·         CSS is also applied slightly differently. Due to XHTML's case-sensitivity, all CSS selectors become case sensitive for XHTML documents. Some CSS properties, such as backgrounds, set on the <body> element in HTML are 'inherited upwards' into the <html> element; this appears not to be the case for XHTML.
The root element of an XHTML document must be html, and must contain an xmlns attribute to associate it with the XHTML namespace. The namespace URI for XHTML is http://www.w3.org/1999/xhtml. The example tag below additionally features an xml:lang attribute to identify the document with a natural language:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">




Kamis, 09 Mei 2013

CSS 3: Text Effect


CSS3 Text Effects

CSS3 contains several new text features.
In this chapter you will learn about the following text properties:
  • text-shadow
  • word-wrap

Browser Support

PropertyBrowser Support
text-shadow
word-wrap
Internet Explorer 10, Firefox, Chrome, Safari, and Opera support the text-shadow property.
All major browsers support the word-wrap property.
Note: Internet Explorer 9 and earlier versions, does not support the text-shadow property.

CSS3 Text Shadow

In CSS3, the text-shadow property applies shadow to text.
Text shadow effect!
You specify the horizontal shadow, the vertical shadow, the blur distance, and the color of the shadow:
OperaSafariChromeFirefoxInternet Explorer

Example

Add a shadow to a header:
h1
{
text-shadow: 5px 5px 5px #FF0000;
}

Try it yourself »


CSS3 Word Wrapping

If a word is too long to fit within an area, it expands outside:
This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.
In CSS3, the word-wrap property allows you to force the text to wrap - even if it means splitting it in the middle of a word:
This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.
The CSS code is as follows:
OperaSafariChromeFirefoxInternet Explorer

Example

Allow long words to be able to break and wrap onto the next line:
p {word-wrap:break-word;}

Try it yourself »


New Text Properties

PropertyDescriptionCSS
hanging-punctuationSpecifies whether a punctuation character may be placed outside the line box3
punctuation-trimSpecifies whether a punctuation character should be trimmed3
text-align-lastDescribes how the last line of a block or a line right before a forced line break is aligned when text-align is "justify"3
text-emphasisApplies emphasis marks, and the foreground color of the emphasis marks, to the element's text3
text-justifySpecifies the justification method used when text-align is "justify"3
text-outlineSpecifies a text outline3
text-overflowSpecifies what should happen when text overflows the containing element3
text-shadowAdds shadow to text3
text-wrapSpecifies line breaking rules for text3
word-breakSpecifies line breaking rules for non-CJK scripts3
word-wrapAllows long, unbreakable words to be broken and wrap to the next line3

Rabu, 06 Maret 2013

Fakta Unik Tentang Kucing

         Kucing merupakan hewan peliharaan yang sudah dekat dengan manusia daripada jenis hewan peliharaan yang lain menurut para ahli paling tidak sejak tahun 3.500 SM orang mesir telah bersahabat dengan mamalia yang memiliki nama latin Felis Silvestris Catus ini. Hewan telah membantu menjaga lumbung-lumbung petani dari hama tikus yang mengganggu pada masa itu.
         Ada beberapa hal yang tidak banyak diketahui orang tentang hewan lucu ini, diantaranya adalah tidak semua kucing termasuk dalam garis keturunan murni. Jenis kucing yang masuk dalam keturunan murni hanya ada 4 jenis saja yaitu persia, siam, manx dan sphinx yang jumlanya hanya 1% dari seluruh kucing di dunia selain dari itu merupakan jenis keturunan campuran. Pada umumnya kucing tidak suka berendam dalam air namun ada satu jenis kucing yang menyukai hal itu jenis yaitu Turkish Van. Masa kehamilan kucing adalah 63 hari.Saat dilahirkan mereka dalam keadaan buta dan tuli dan mulai membuka matanya saat berusia 8-10 hari. Kucing mampu mengandung 4 janin sekaligus karena bentuk rahim mereka yang memiliki 4 bagian yang berbeda. Di masa Mesir kuno kucing dianggap sebagai penjelmaan Dewi Bast/Bastet/Thet dan hukum membunuh kucing adalah hukuman mati. Dalam Syariat Islam menyakiti, membunuh dan bahkan dalam hal jual-beli merupakan tindakan yang diharamkan ini didasarkan pada dalil hadis Nabi Muhammad dan kaidah fiiqih(al-qawa'id al-kulliyah). Namun di Eropa pada zaman dahulu sering dibunuh yaitu sekitar abad ke-14 kerena menurut mereka kucing identik dengan penyihir dan juga menjadi penyebar penyakit karena bersekutu dengan setan, bahkan sampai sekarang masih banyak orang eropa yang mempercayai bahwa kucing berwarna hitam dapat menyebabkan kesialan atau bencana terjadi.
      Itu tadi merupakan fakta-fakta tentang kucing yang tidak banyak diketahui oleh orang. Semoga setelah kita membaca tulisan di atas kita dapat lebih menghargai sesama makluk ciptaan Tuhan tersebut. Terima Kasih