PDA

View Full Version : How to configure CSS Background in a box


Dantplayer
10-02-2008, 06:52 PM
Hey guys,

I want to take a (1x56 px) strip of a fading out gradient and repeat it across the x-axis inside a CSS box. Basically, I want to take the blue background on my site:
www.aplus-students.com

And apply it to a smaller box that will say "Recent News" inside it.

How do I create a CSS box? I copied one from one of the templates that Dreamweaver gives me, and tried reformatting it, but when I do that, the background applies to the whole page instead of just the CSS box. Like this:

http://www.aplus-students.com/Images/Dreamweaver-CSS-problem.jpg

You can see the dotted box in the middle...that's that box that I want the green background to apply *only* to.

I must be going to the wrong place, or creating the CSS box from the wrong location...but where do I go then?

domedia
10-02-2008, 07:04 PM
Don't copy and paste because there might be attributes that are being copied along with it.

Just make the box from scratch and you should have no problem.

Welcome to the forums btw!

Dantplayer
10-03-2008, 11:30 PM
Thanks!

I feel like this is a silly questions, but how do I create a CSS box? There must be a button on the CSS panel on the right hand side that I'm not seeing.

I've tried googleing this too, and all I can find are tutorials that cover the raw HTML...don't people know that DW tends to focus on wjsiwyg?

Rob_Che
10-04-2008, 12:22 AM
What do you mean by "box" ? Containers ?

CSS uses containers called divs

<div id="myStuff">
Stuff!
</div>
The div can then by styled and positioned - eg;

#myStuff {
height: 200px ;
background-image: url(../images/bg.gif) ;
margin-top: 10px;
padding: 5px; }


Here's the box model...
http://www.w3.org/TR/CSS2/box.html

Rob
(http://www.w3.org/TR/CSS2/box.html)

Dantplayer
10-05-2008, 04:11 AM
Ok, I'll give that try.

With respect to CSS, what I would really like to do is read a whole summary that starts with the basics and teaches everything there is to know about CSS. I don't mind spending a lot of time reading an analyzing; I have a lot of that.

Cary
10-05-2008, 05:55 AM
With respect to CSS, what I would really like to do is read a whole summary that starts with the basics and teaches everything there is to know about CSS.

Here's a CSS tutorial (http://www.w3schools.com/css/) which teaches a lot.

domedia
10-05-2008, 05:45 PM
Two SP books that will teach you almost everything:

1. Build Your Own Web Site The Right Way Using HTML & CSS
Takes you from the basics to a CSS/HTML website

2. The Art & Science Of CSS
Some of the CSS gurus shows you techniques that takes you from a regular CSS designer, to the CSS expert level.

Get the first book if you just want to learn CSS and take it by yourself from there. Get the 2nd book if you want to take it to the next level after that ;)

http://www.dreamweaverclub.com/books/shop.php?c=books&n=5&i=0975240293
http://www.dreamweaverclub.com/books/shop.php?c=books&n=5&i=0975841971

Dantplayer
10-05-2008, 07:50 PM
Hey thanks alot! I'll check them out on Amazon.ca or abe.com.