Total members 11895 |It is currently Sun Dec 22, 2024 9:10 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





In this code we use CSS attributes to change the margin and the padding of two paragraphs .

Code:


<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Change the margin and the padding of the paragraph</title>
<
style type="text/css">

p.parah1 {
 
 margin
: 20px 21px 32px 0;
 padding: 0;
  border:1px dashed green;
}
p.parah2 {
 
 margin
: 0 3px 5px 2px;
 padding: 40px;
 border:1px solid red;
}

   

</style>
</
head>

<
body>
  <h1>Header Title</h1>

  

  
<p class="parah1" >This is the first paragraph , notice the margin configuration.</p>

<
p  class="parah2" > This is the second paragraph; CSS margin attribute takes the affects. </p>
</
body>
</
html>
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Change the margin and padding of paragraph
 change background of the paragraph     -  
 Change the word spacing in paragraph     -  
 Change the text indent in the paragraph     -  
 set margin to body tag     -  
 adding padding to your text     -  
 id Selector with paragraph     -  
 hide paragraph using jquery     -  
 Changing the line height of the paragraph     -  
 Setting maximum height of paragraph -P tag     -  
 enlarge first letter in html paragraph     -  



Topic Tags

HTML Paragraph






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com