
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Set the right margin of an element with CSS
The margin-right property is used to set the right margin of an element. It can have a value in length, % or auto. You can try to run the following code to set the right margin
Example
<html> <head> </head> <body> <p style = "margin-right: 10px; border:2px solid red;"> Cricket crazy nation India! </p> <p style = "margin-right: 10%; border:2px solid green;"> Cricket crazy nation Australia! </p> </body> </html>
- Related Articles
- Set the top margin of an element with CSS
- How to set the right margin of an element with JavaScript?
- Usage of margin-right property with CSS
- How to set the left margin of an element with JavaScript?
- How to set the bottom margin of an element with JavaScript?
- How to set the top margin of an element with JavaScript?
- How to set the bottom margin of an element?
- Specify the right padding of an element with CSS
- Set the background color of an element with CSS
- Set the background image of an element with CSS
- Set the font stretch of an element with CSS
- How to set the right padding of an element with JavaScript?
- Set right tooltip with CSS
- Perform Animation on CSS margin-right property
- Usage of margin property with CSS

Advertisements