Category Archives: CSS

How to Add Padding in DIV?

Padding is used to create space around an element’s content, inside of any defined borders. CSS Padding The CSS padding properties are used to generate space around an element’s content, inside of any defined borders. With CSS, you have full control over the padding. There are properties for setting the padding for each side of an element… Read More »

Category: CSS

Add Margin in Div Using CSS

Margins are used to create space around elements, outside of any defined borders. CSS Margins The CSS margin properties are used to create space around elements, outside of any defined borders. With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and… Read More »

Category: CSS

How to Add Border in element and div?

he CSS border properties allow you to specify the style, width, and color of an element’s border. CSS Border Style The border-style property specifies what kind of border to display. The following values are allowed: dotted – Defines a dotted border dashed – Defines a dashed border solid – Defines a solid border double – Defines a double border groove – Defines… Read More »

Category: CSS

How To Add Background in HTML Page?

The CSS background properties are used to add background effects for elements. In these chapters, you will learn about the following CSS background properties: background-color background-image background-repeat background-attachment background-position background (shorthand property) CSS background-color The background-color property specifies the background color of an element. Example The background color of a page is set like this: <!DOCTYPE html> <html>… Read More »

Category: CSS

How To Add Comment in CSS

CSS comments are not displayed in the browser, but they can help document your source code. CSS Comments Comments are used to explain the code, and may help when you edit the source code at a later date. Comments are ignored by browsers. A CSS comment is placed inside the <style> element, and starts with /* and ends with */:… Read More »

Category: CSS

How To Add CSS

When a browser reads a style sheet, it will format the HTML document according to the information in the style sheet. Three Ways to Insert CSS There are three ways of inserting a style sheet: External CSS Internal CSS Inline CSS External CSS With an external style sheet, you can change the look of an… Read More »

Category: CSS

How to Define Selector in CSS?

A CSS selector selects the HTML element(s) you want to style. CSS Selectors CSS selectors are used to “find” (or select) the HTML elements you want to style. We can divide CSS selectors into five categories: Simple selectors (select elements based on name, id, class) Combinator selectors (select elements based on a specific relationship between them)… Read More »

Category: CSS

Syntax Declaration in CSS

CSS Syntax The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon. Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces. Example In… Read More »

Category: CSS

What is Cascading Style Sheets(CSS)& Introduction

CSS stands for Cascading Style Sheets CSS describes how HTML elements are to be displayed on screen, paper, or in other media CSS saves a lot of work. It can control the layout of multiple web pages all at once External stylesheets are stored in CSS files Why Use CSS? CSS is used to define… Read More »

Category: CSS