PDA

Click to See Complete Forum and Search --> : Need Help PLease!!!


rmexhibition
07-14-2007, 10:29 PM
Hey Guys,

Im trying to make a CSS Layout for my online portfolio and I finally found a website that looks similar to the final product i had in mind. ( http://www.kreativika.com/ ) I just have no about how to go about making it this way. I dont even know how to start actually. Im find with the javascript codes but how do i get my DIVS to be centered like that and the background image not to move at all. Please help. any information would be greatly appreciated.

:confused:
-rm

Two-Toe Tom
07-14-2007, 11:01 PM
welcome to the forum! :)

i'd start by googling for some css tutorials, i'm sure there's a bunch around. you can also view their source code to see how they've done it.

tZ
07-15-2007, 12:42 AM
rmexhibition wrote:

How do i get my DIVS to be centered like that and the background image not to move at all.


its not javascript just CSS.

background: url(images/whatever.jpg) repeat-x;

I think… its something like that.

here's the shorthand guide in case what I provided doesn't work:
http://www.dustindiaz.com/css-shorthand/

To center the div is a bit more involved- if you want to do it correctly. However, it can be done without javascript also. I currently don't remember how to do it but, its not all that difficult. I'm sure someone will chime in.

these books go everything very well I just don't use CSS that often so I forget some of it but, here's the links:

http://www.amazon.com/Build-Your-Website-Right-Using/dp/0975240293/ref=sr_1_15/103-6830699-8153455?ie=UTF8&s=books&qid=1184460959&sr=8-15

http://www.amazon.com/HTML-Utopia-Designing-Without-Tables/dp/0975240277/ref=pd_bbs_2/103-6830699-8153455?ie=UTF8&s=books&qid=1184460941&sr=8-2

http://www.amazon.com/CSS-Mastery-Advanced-Standards-Solutions/dp/1590596145/ref=pd_bbs_sr_2/103-6830699-8153455?ie=UTF8&s=books&qid=1184461050&sr=1-2

katgal
07-15-2007, 07:20 PM
It's actually quite simple.

To make the background image "not move" you need to use background-attachment:fixed in your stylesheet.

To center the main div on the page, you need to use text-align:center in your body style (this is all in css) and set the main div's margin to margin:0 auto.

Then, assuming you want text in div to align left, you add text-align:left to the div style.

Take a look at this quick example (http://www.sarasvirtualkitchen.com/center_div_example.htm). View page source to see the code.

hewligan
07-15-2007, 09:51 PM
You don't need text-align: center to center the div - it works on text, not block level elements.

To centre a block level element like a div, you just need to use the margin: 0 auto. Check the example you posted - it doesn't use text-align to centre the div at all.

katgal
07-15-2007, 09:56 PM
You're absolutely right. And I'm not sure what I was thinking when I wrote that. If you indeed look at the code in my example, I didn't use text-align in the body style.

LOL

It's been a very long week.

rmexhibition
07-16-2007, 01:55 AM
thank you guys for all the replies. it really did help alot. i could not find how to center divs on any css tutorial.


THank you thank you