View previous topic :: View next topic |
Author |
Message |
C-Dizzle Grandmaster Cheater
Reputation: 89
Joined: 16 Mar 2008 Posts: 623
|
Posted: Mon Aug 02, 2010 11:08 am Post subject: (CSS)I need some help. |
|
|
So as I have been learning this I have made a page with all the information on so I can use it in the future but I have run into a problem with background colour. I have been looking at making different areas different colors
Code: | <head>
<style type="text/css">
h1
{
background-color:#6495ed;
}
p
{
background-color:#e0ffff;
}
div
{
background-color:#b0c4de;
}
</style>
</head> |
But I have found that it also makes all previous lines under the tag change color also. So my question is how do I confine the color change to a single area?
|
|
Back to top |
|
 |
Maes Advanced Cheater
Reputation: 10
Joined: 09 Apr 2009 Posts: 50
|
|
Back to top |
|
 |
C-Dizzle Grandmaster Cheater
Reputation: 89
Joined: 16 Mar 2008 Posts: 623
|
Posted: Mon Aug 02, 2010 11:33 am Post subject: |
|
|
Rokurai wrote: | There is a simpler method for colors, then posting for help.
Just make an image with the colors you want, with the page dimensions, and use this: Code: | body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
} |
|
Thanks, but I would still like to know how to confine it so I can expand my learning.
|
|
Back to top |
|
 |
shitposter Newbie cheater
Reputation: 5
Joined: 12 Nov 2008 Posts: 13
|
Posted: Mon Aug 02, 2010 11:40 am Post subject: |
|
|
Are you not using a seperate CSS file for the code? :c
|
|
Back to top |
|
 |
C-Dizzle Grandmaster Cheater
Reputation: 89
Joined: 16 Mar 2008 Posts: 623
|
Posted: Mon Aug 02, 2010 11:48 am Post subject: |
|
|
xTremist wrote: | Are you not using a seperate CSS file for the code? :c |
I'm making the page as I go along. It's on something where I can get all the information in one place and try things out.
|
|
Back to top |
|
 |
Lyfa The Lonely Man
Reputation: 12
Joined: 02 Nov 2008 Posts: 743
|
Posted: Mon Aug 02, 2010 12:02 pm Post subject: |
|
|
You shouldn't change complete tags. Instead, create some classes/IDs:
Code: | <style type="text/css">
/* # is for ID <div id="whatever"> and . is for class <div class="whatever"> */
#para1 {
background-color: #959595;
}
</style> | but for your predicament you'd probably want to use the width tag:
Code: | <style>
#para1 {
background-color: #959595;
width: 500px;
}
</style> |
_________________
|
|
Back to top |
|
 |
C-Dizzle Grandmaster Cheater
Reputation: 89
Joined: 16 Mar 2008 Posts: 623
|
Posted: Mon Aug 02, 2010 12:05 pm Post subject: |
|
|
F3ar wrote: | You shouldn't change complete tags. Instead, create some classes/IDs:
Code: | <style type="text/css">
/* # is for ID <div id="whatever"> and . is for class <div class="whatever"> */
#para1 {
background-color: #959595;
}
</style> | but for your predicament you'd probably want to use the width tag:
Code: | <style>
#para1 {
background-color: #959595;
width: 500px;
}
</style> |
|
Thank you <3
|
|
Back to top |
|
 |
|