IT. Expert System.

CSS

CSS Application


CSS Application

There are three basic ways to apply CSS styles to an HTML document. They are:

  • Inline
  • Internal
  • External

Inline

Inline styles are applied directly to the HTML by using the style attribute.

The following style sets the text color of the text in this paragraph to 'blue'.

<p style="color:blue;">text</p>

Use Inline styles sparingly and only when a single element has a unique style to be applied.

Internal

Internal styles are specified within the <head></head> tags of an HTML document and apply to the whole document. The following example would set the text color to blue for all paragraphs in the document.

<html>
<head>
  <title>CSS Inline Example</title>
  <style type="text/css">
    p {
      color:blue;
    }
  </style>
</head>

Use Internal styles when a single page has a unique style to be applied.

External

External styles are specified in a separate CSS file and 'included' into HTML documents in which they are to apply.

The following code shows the contents of an example style sheet, styles.css:

p {
  color:blue;
}

The following HTML code shows how to include the external style sheet named styles.css into an HTML document. Notice that the <link> tag is specified within the <head></head> tags.

<html>
<head>
  <title>CSS External Example</title>
  <link rel="stylesheet" type="text/css" href="styles.css"/>
</head>

External style sheets are recommended when the styles are to be applied across multiple HTML documents. This allows for consistency throughout an entire web site and any style changes automatically apply to all files that include the style sheet.

CSS Cascading Order

When multiple styles are specified by any of these methods, the styles 'cascade' into a single style by following this list in order of increasing priority:

  1. Browser default
  2. External style sheet
  3. Internal styles
  4. Inline style

Therefore, an Inline style has the highest priority, meaning it will override the same Internal style, or in an External style sheet, or in a browser (a default value).



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 3021 / . Delta: 0.02891 с