Total members 11872 |It is currently Mon Nov 28, 2022 11:05 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Using CSS attributes to change the background color of the P tag in addition to the border color and the paragraph width.

Code:

    
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
    <head>
        <title>Change the background of the paragraph tag</title>
        <style type='text/css'>
            body {
                font: 1em sans-serif;
            }
            p {
                background: rgb(114, 114, 113);
                border: 2px solid red;
                width: 200px;
                padding: 15px;
                color: #FFBBBB;
            }
         
        
</style>
    </head>
    <body>
        <p>
        The paragraph width, background and the border is changed.
        </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 background of the paragraph
 Change the word spacing in paragraph     -  
 Change the margin and padding of paragraph     -  
 Change the text indent in the paragraph     -  
 change background color with RGB     -  
 Change the body tag background in html     -  
 Change background position when mouse over     -  
 Automatic change to webpage background image     -  
 id Selector with paragraph     -  
 hide paragraph using jquery     -  
 enlarge first letter in html paragraph     -  



Topic Tags

HTML Paragraph
cron





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