Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML CSS

CSS code not work

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: macek, egami, gesf

CSS code not work

Postby echipbk » Wed Jan 11, 2012 7:50 pm

HTML code:
Code: Select all
    <p id="top">
   <p>my color is here</p>
    </p>



CSS code:
Code: Select all
    #top p {
   color:green;
    }



But actually, the above para "my color is here" doesn't change color. Can anyone help me? thanks a lot.
echipbk
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jan 11, 2012 7:45 pm

Re: CSS code not work

Postby rupali » Wed Jan 11, 2012 9:08 pm

hello,

the color that you have mentioned for paragraph it just enclosed with id first <p> tag and not implemented on another text within <p> tag. so use this way as below:

<html>
<head>
<style type="text/css">
#top{
color:green;
}
</style>
</head>
<body>
<p id="top">
my color is here
</p>
</body>
</html>
rupali
New php-forum User
New php-forum User
 
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA


Return to CSS

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.