• Complain

Olsson - CSS Quick Syntax Reference Guide

Here you can read online Olsson - CSS Quick Syntax Reference Guide full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA;New York;N.Y, year: 2014, publisher: Apress, Distributed to the Book trade worldwide by Springer Science+Business, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Olsson CSS Quick Syntax Reference Guide
  • Book:
    CSS Quick Syntax Reference Guide
  • Author:
  • Publisher:
    Apress, Distributed to the Book trade worldwide by Springer Science+Business
  • Genre:
  • Year:
    2014
  • City:
    Berkeley;CA;New York;N.Y
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

CSS Quick Syntax Reference Guide: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "CSS Quick Syntax Reference Guide" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

In this book you will find: a concise reference to CSS; short, simple, and focused code examples for presentation semantics; a well laid out table of contents and a comprehensive index allowing easy review. Youll learn how to handle fundamentals like adding styles to HTML/XHTML as well as rule structure, style precedence, element classifications and display roles, visual layout, and floating and table layouts; how to work with CSS values like keywords, color and number values, percentage values, length values, and strings; how to apply CSS selectors: structural pseudo-classes, the negation pseudo-class, interaction pseudo-classes, pseudo-elements, and media queries; how to use CSS property references like universal values, visual media, paged media, and more. This book is for experienced CSS developers as well as other programmers and Web developers new to CSS. --

Olsson: author's other books


Who wrote CSS Quick Syntax Reference Guide? Find out the surname, the name of the author of the book and a list of all author's works by series.

CSS Quick Syntax Reference Guide — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "CSS Quick Syntax Reference Guide" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Mikael Olsson 2014
Mikael Olsson CSS Quick Syntax Reference Guide 10.1007/978-1-4302-6491-0_1
1. Using CSS
Mikael Olsson 1
(1)
Hammarland, Finland
There are three ways to insert CSS into an HTML document: by using an internal style sheet, inline styles, or an external style sheet. An internal style sheet applies to a single page, an inline style to a single element, and an external style sheet to potentially an entire web site.
Internal style sheet
An internal style sheet is useful when a single document needs to have its own unique styling. The style sheet is then embedded within the section of the web document using the element. This element is a container for style sheet rules and should have its type attribute set to "text/css" .
p { color: red; }
Inline style
Stylingcan be assigned to an individual element by using the style attribute to set an inline style. It is a generic attribute that can be included in any HTML start tag, and its value is the CSS declarations that will be applied to the element, separated by semicolons. There is no need to specify a selector because the declarations implicitly belong to the current element.

Green text

This approach should be used sparingly because it mixes style with content and therefore makes future changes more cumbersome. It can be useful as a quick way to test styles before they are moved out to an external style sheet.
External style sheet
The most common way to include CSS is through an external style sheet. The style sheet rules are placed in a separate text file with a .css file extension. This style sheet is then referenced using theelement in the web page header. The rel (relationship) attribute must be set to "stylesheet" and the meta type attribute can optionally be set to "text/css" . The location of the style sheet is specified with the href attribute.
Another less common way to include an external style sheet is to use the CSS @import function from inside of the element. For this function to work, it must be placed before any other rules.
@import url("MyStyle.css");
Using an external style sheet is often preferred because it completely separates CSS from the HTML document. It is then possible to quickly create a consistent look for an entire web site and to change its appearance just by editing a single CSS document. It also has performance benefits because external style sheets are cached and therefore need to be downloaded only oncefor the first page a visitor views at your site.
Testing environment
To experiment with CSS, you can use a simple text editor such as Notepad in Windows (found under Start Programs Accessories Notepad) or TextEdit on a Mac (found under Finder Applications TextEdit). Type the following single style rule into a new document in the editor. The rule will color the background of a web document red.
body { background: red; }
Save the file as MyStyle.css and then open another empty document. This new document will become the HTML file that uses the external style sheet you just created. Write the following HTML markup into the document, which includes a reference to the style sheet along with the minimal markup for a HTML 5 web document:

This page is red

Go ahead and save this text file as MyPage.html in the same folder as the CSS file. You have now created a simple environment in which you can test CSS. To view the page, open MyPage.html with your web browser. You will see that the background is indeed colored red because of the rule in the style sheet.
View source
While you have the browser opened, you can view the HTML markup that makes up the page by pressing Ctrl+U on a PC or Cmd+U on a Mac. This shortcut works in all major browsers, including Chrome, Firefox, and Internet Explorer (IE). You can also find the view source window by right-clicking on the page and selecting View Source. In Firefox and Chrome, the style sheet is clickable, allowing you to view the external style sheet rules that apply to the web page. (Note that in Chrome, you have to right-click the style sheet and select to open it because this file is stored on your local machine.)
Viewing the source code of web pages like this provides a great way to learn from other web developers. Whenever you find an interesting element on a web pagewhether it is created with HTML, CSS or JavaScriptthe page source will reveal how it was created.
Comments
Comments in CSS are created by using the C-style notation ( /* */ ). Everything placed between /* and */ will be ignored by browsers, even if the delimiters span multiple lines.
/* Multi-line
Comment */
The main use of comments is to clarify the code to developers, including you in the future. They can also be used to improve readability by delimiting sections of the style sheet or providing meta data about the file, such as the authors name.
/*
* Meta data
*/
/*** Section heading ***/
p { margin-top: -1px; } /* clarification */
Comments are also useful for temporarily deactivating declarations or entire style rules for testing purposes.
p { /* color: white; */ }
Whitespace
Whitespacerefers to spaces, tabs, and new lines. You are free to format your style sheets however you like with whitespace to make them easier to read. One common formatting convention is to split declarations across multiple lines.
.fruit {
color: red;
margin: 1px;
}
Another popular convention is to keep a rules declarations in a single line and split the declarations into multiple lines only when they become too numerous.
.fruit { color: red; margin: 1px; }
.fruit.apple { color: green; margin: 2px; }
The formatting you use is a matter of preference. Choose the one that makes sense to you and aim to keep it consistent.
Mikael Olsson 2014
Mikael Olsson CSS Quick Syntax Reference Guide 10.1007/978-1-4302-6491-0_2
2. Grouping
Mikael Olsson 1
(1)
Hammarland, Finland
To keep style sheets short and easy to edit, similar rules can be grouped together. This grouping offers several ways to specify a set of related rules. For example, you can color the text red and the background black for two header elements in four different ways, as described in the following sections.
Ungrouped rules
Each rule can be written separately, which allows you to apply individual style rules to each selected element.
h1 { color: red; }
h1 { background: black; }
h2 { color: red; }
h2 { background: black; }
Grouped selectors
The selectors can be grouped together by separating them with a comma. This grouping will make the declaration apply to multiple selectors.
h1, h2 { color: red; }
h1, h2 { background: black; }
Grouped declarations
The declarations can be grouped together by separating them with a semicolon. All styles within the declaration block will be applied to the selector.
h1 {
color: red;
background: black;
}
h2 {
color: red;
background: black;
}
Grouped selectors and declarations
Both the selectors and declarations can be combined, resulting in a single rule.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «CSS Quick Syntax Reference Guide»

Look at similar books to CSS Quick Syntax Reference Guide. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «CSS Quick Syntax Reference Guide»

Discussion, reviews of the book CSS Quick Syntax Reference Guide and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.