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

could not change background color of the "content" div.

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

Moderators: macek, egami, gesf

could not change background color of the "content" div.

Postby nadeem14375 » Wed May 25, 2011 11:11 pm

hi all,

I am new to web designing.

here is my css.
---------------------------------------------------------------------
height : 300px;
/* add background image */
background-image : URL(images/grroop-top-island.jpg);
/* display background only once */
background-repeat : no-repeat;
/* center heading division on page */
margin-left: auto;
margin-right: auto;
}


/* define size of main division and center on page */
#main {
width: 900px;
height: 500px;
/* center division on page */
margin-left: auto;
margin-right: auto;
}


/* define size of left division, center links, locate and add color */
#left {
width: 222px;
height: 500px;
/* center link buttons */
text-align: center;
/* send this div to first available (left) location within main div */
float: left;
/* set back color of this division */
background-color: #FF8040;
/* set left margin
//margin-left: 50;
}

/* define size of content division, locate and control overflow */
#content {
width: 900px;
height: 500px;
/* set back color to white */
background-color: #FFFFFF;
/* send this div to next available location (left) within main div */
float: left;
/* initiate scroll bars if too much content is added */
overflow: auto
}
---------------------------------------------------------------------

and here is HTML

---------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<HTML>
<HEAD>
<link rel="stylesheet" href="mystyle.css"
type="text/css">
</head>

<body>

<div id="center-page">
<div id="heading">
</div>

<div id="main">
<div id="left">
"left1"<br>
"left2"<br>
"left3"<br>
"left4"<br>
"left5"<br>
</div>

<div id="content">
"content1"<br>
"content2"<br>
"content3"<br>
"content4"<br>
"content5"<br>
</div>
</div>
<div id="footer">
</div>

</body>
</html>
--------------------------------------------------

Couldn't able to change the background color of content div.

whats wrong?

Regards

MN
nadeem14375
New php-forum User
New php-forum User
 
Posts: 6
Joined: Wed May 25, 2011 10:53 pm

Re: could not change background color of the "content" div.

Postby saefulloh » Thu May 26, 2011 1:12 am

am.. i newbie for web. but i try your code.

Code: Select all
/* set back color to white */
background-color: #FFFFFF;


background color =white. then i cange

Code: Select all
/* set back color to blue*/
background-color: blue;


background color = blue. whats wrong ?
saefulloh
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed May 25, 2011 10:44 pm

Re: could not change background color of the "content" div.

Postby gandahar » Wed Jun 29, 2011 11:01 am

try it locally to be sure

like :

Code: Select all
<div style="background: red;">


try to use class="divcontent"

like :
Code: Select all
<style>
.divcontent { background: red; }
</style>


<div class="divcontent"></div>
User avatar
gandahar
New php-forum User
New php-forum User
 
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am


Return to CSS

Who is online

Users browsing this forum: No registered users and 2 guests

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