css

CSS Home

CSS stands for Cascading Style Sheets. CSS is a markup language that describes the style of HTML documents, which means specifying how the documents will be displayed to users. You will learn the basics step-by-step in this CSS tutorial, and explore advanced features of CSS by combining online examples. Now let’s start the journery! CSS online demo You will get a lot of …

CSS Home Read More »

CSS Introduction

Before deeping into CSS, you need to understand the background of CSS and other related web technologies. What is CSS CSS means Cascading Style Sheets. CSS styles which define how to display HTML elements are usually stored in style sheets. External style sheets which can be applied into multiple pages can improve our efficiency obviously. And the external style …

CSS Introduction Read More »

CSS Syntax

A CSS rule consists of a selector and one or more declarations.Like this: selector {declaration1; declaration2; … declarationN } A selector is usually an HTML element that you need to define styles. It can be an HTML tag name, a class name, or an element ID. Each declaration consists of a CSS property and a …

CSS Syntax Read More »

CSS Selectors

The CSS selector specifies the HTML elements that need to define the style. The CSS selector mainly has the following 6 types: Element selector Id selector Class selector Attribute selector Descendant selector Child selector Element Selector The element selector directly uses the element name to select the HTML element. The following code allows you to …

CSS Selectors Read More »

How To Create CSS

The browser formats the HTML document according to the loaded style sheet.Browsers parse style sheets very quickly. How to insert a style sheet in the HTML document There are 3 ways to insert a style sheet in an HTML document: External style sheet Internal style sheet Inline style sheet External style sheet When styles need …

How To Create CSS Read More »

CSS Backgrounds

The CSS background property is used to define the background effect of HTML elements. We can set the background color or the background image in CSS. The common CSS background properties are as follows: background-color:to set the background color background-image:to set the background image background-repeat:to set the repeat mode of the background image background-attachment:to set whether the background image scroll with the page background-position:to …

CSS Backgrounds Read More »

CSS Margins

The CSS margin property is used to create “space” around the HTML element. This “space” is defined outside the element border. You can set the top, bottom, left, and right margins of the element individually, or you can use the margin property to set all the margins at the same time. The following diagram shows …

CSS Margins Read More »

CSS Padding

The CSS Padding property defines the space between the element’s border and the element’s content.The padding (top, right, bottom, left) can be set on all four sides of the element. CSS Padding Property The padding property values accept length or percentage values, but negative values are not allowed. The following diagram shows the relationship between the …

CSS Padding Read More »

CSS Text

There are some properties in CSS that define the appearance of text, including: text-align, text-decoration, text-transform, text-indent, and so on. With these properties, you can change the text’s alignment, spacing, indentation, and more. Text Alignment The text-align property sets the horizontal alignment of the text. The following example shows left-aligned, right-aligned, and center-aligned text: Note: …

CSS Text Read More »

CSS Fonts

CSS font properties define the font families, sizes, boldness, and styles (such as italics) of the text. Font Families There are two different types of font families in CSS: generic family – a group of font families with a similar look (like “Serif” or “Monospace”) font family – a specific font family (like “Times New …

CSS Fonts Read More »