Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

CSS Quick Syntax Reference
CSS Quick Syntax Reference
CSS Quick Syntax Reference
Ebook172 pages1 hour

CSS Quick Syntax Reference

Rating: 0 out of 5 stars

()

Read preview

About this ebook

The CSS Quick Syntax Reference is a 150-page syntax reference to the Cascading Style Sheet specification and style sheet language. It presents the essentials of CSS in a well-organized format that can be used as a handy reference.

You won’t find any technical jargon, bloated samples, drawn out history lessons or witty stories in this book. What you will find is a CSS reference that is concise, to the point, and highly accessible. The book is packed with useful information and is a must-have for any CSS programmer or Web developer.

In the CSS Quick Syntax Reference, 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
LanguageEnglish
PublisherApress
Release dateSep 16, 2014
ISBN9781430264910
CSS Quick Syntax Reference
Author

Mikael Olsson

Mikael Olsson is a professional programmer, author and web entrepreneur. He enjoys teaching, writing books and making sites that summarize various fields of interest. The books he writes are focused on teaching their subject in the most efficient way possible, by explaining only what is relevant and practical without any unnecessary repetition or theory. He can be reached online at Siforia.com.

Read more from Mikael Olsson

Related to CSS Quick Syntax Reference

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for CSS Quick Syntax Reference

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    CSS Quick Syntax Reference - Mikael Olsson

    © Mikael Olsson 2014

    Mikael OlssonCSS Quick Syntax Reference Guide10.1007/978-1-4302-6491-0_1

    1. Using CSS

    Mikael Olsson¹ 

    (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

    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.

    color: green>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 the element 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.

    stylesheet type=text/css href=MyStyle.css>

    Another less common way to include an external style sheet is to use the CSS @import function from inside of the

    Enjoying the preview?
    Page 1 of 1