ASP.NET Basics

HTML Basics
ASP.NET Web Server
Advanced HTML
Application Designing
Using Visual Studio
ASP.NET Standards
ASP.NET Styling
ASP.NET Navigation

ASP.NET Tips

ASP.NET Validation
HTML forms
CSS Styling
CSS Advanced
ASP.NET Features
ASP.NET Image Effects
Common mistakes
DB Design tips

Building Applications

Design Secure Apps
Build Secure Apps

1. CSS Margin

« Previous Chapter

Next Chapter »

CSS Margins is a shortcut property, like CSS padding. You can use CSS margins to make a space around the edges of a web page element which background color or images cannot fill.

In CSS margins, the constituent values are addressed in the TRBL (Top, Right, Bottom and Left) order.

Note:

  • If one value is assigned, like “margin: 10px;” the spacing will be applied to all four edges.

  • This is the same as “margin-top: 10px; margin-right: 10px; margin-bottom: 10px;margin-left: 10px;

In the following table you will see the CSS spacing property, margins, available for you with a description of these properties alongside.

Property

Description

margin

CSS Shortcut placeholder for all margin properties (TRBL – Top, Right, Bottom and Left)

margin-bottom

To set the bottom margin for an element.

margin-left

To set the left margin for an element

margin-right

To set the right margin for an element

margin-top

To set the top margin for an element

CSS Margin properties

Go to the next chapter to see how to use the CSS margin property.

« Previous Chapter

Next Chapter »

Table of Contents

» Chapter 1 - CSS Margin
Chapter 2 - CSS Padding
Chapter 3 - CSS Border and Outline properties
        Chapter 3.1 - CSS border
Chapter 4 - CSS Dimensions
        Chapter 4.1 - CSS height and width
Chapter 5 - CSS Positioning Properties
        Chapter 5.1 - CSS float
        Chapter 5.2 - CSS z-index
        Chapter 5.3 - CSS clear
        Chapter 5.4 - CSS cursor

[top]