PDA

View Full Version : UGH! div and scroling to the right


newbiedesigner
11-13-2008, 02:48 PM
i have a site at: www.rawcenterforstrength.com and css at www.rawcenterforstrength.com/css_raw.css

i design on a small laptop and now when i opened on a large monit entire sight moves to the right. how can i fix this?

thank you!

domedia
11-13-2008, 03:08 PM
Use your #container to center your content.
Tutorial here:
http://www.dreamweaverclub.com/css-center-content.php

newbiedesigner
11-13-2008, 03:56 PM
Use your #container to center your content.
Tutorial here:
http://www.dreamweaverclub.com/css-center-content.php


thx a lot for your help! i tried the liquid method and uploaded test html here:

http://rawcenterforstrength.com/indextest.html

but do you still see it scroll to the right?

Corrosive
11-13-2008, 04:40 PM
thx a lot for your help! i tried the liquid method and uploaded test html here:

http://rawcenterforstrength.com/indextest.html

but do you still see it scroll to the right?

I think you've got margin:0 and auto styling your container div. Try taking the '0' out of it and spelling 'margin' with an 'r' :wink:

Should be..

#container {margin: auto;}

Cheers

newbiedesigner
11-13-2008, 04:45 PM
LOL i didn't notice that ; but when i created the indextest.html i just copied and pasted from the tutorial .

anyways i did change the original .css and it still goes to the right. :(

Corrosive
11-13-2008, 04:49 PM
LOL i didn't notice that ; but when i created the indextest.html i just copied and pasted from the tutorial .

anyways i did change the original .css and it still goes to the right. :(

OK, couple more things I've spotted (nice design btw). Your opening 'body' tag is after your div 'container'. Swap them round. You also need a doctype at the top of your html page.


<body onLoad="MM_preloadImages('contact_us.jpg','training_on.jpg ','events_on.jpg','aboutus_on.jpg','contact_on.jpg ')">

<div id="container">

newbiedesigner
11-13-2008, 05:00 PM
thank you!

changed both. although i wasn't sure what doctype i should include. i used:

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

i also tried:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Corrosive
11-13-2008, 05:15 PM
thank you!

changed both. although i wasn't sure what doctype i should include. i used:

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

i also tried:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I'm sure you don't want to get into the eternal debate about which doctype to use. The first one should be fine.

Has moving the div container worked?

newbiedesigner
11-13-2008, 05:18 PM
it hasn't fixed the problem. :(

Corrosive
11-13-2008, 05:20 PM
it hasn't fixed the problem. :(

If it's still the same test URL then you haven't switched the opening <body> tag and the container div over.

domedia
11-13-2008, 05:28 PM
Look at your code, you cannot declare an html document if you're using xhtml and vice versa.

Edit: looked at your page and it does not qualify as a HTML document.
You're missing the body tag, this one is required. You're missing other elements as well.

You're table structure is also broken.
If you validate your code, it will show you all the errors.

newbiedesigner
11-13-2008, 05:41 PM
okay.. wrong file.

i moved the HTML div underneath body ... problem still exists.

Corrosive
11-13-2008, 05:52 PM
okay.. wrong file.

i moved the HTML div underneath body ... problem still exists.

Domedia is right. Validate your page here...

http://validator.w3.org/

I get 37 errors and one of them may well be the problem. I think your major issue is using tables for layout. You know any CSS?

newbiedesigner
11-13-2008, 05:56 PM
not much.

i guess the lesson learned here is knowing photoshop and dreamweaver isn't enough to create websites? cause most of those errors came from what i created in dreamweaver.

Corrosive
11-13-2008, 06:03 PM
i guess the lesson learned here is knowing photoshop and dreamweaver isn't enough to create websites?

Not really. That is enough to create sites but you need to understand a bit of what is going on in the background (e.g. code) when DW works its magic.

I like your site and am feeling helpful so PM me if you want some help pulling it together the right way.

domedia
11-13-2008, 09:42 PM
Dreamweaver will never put anything between the ending HEAD and starting BODY tag. You manually inserted it. And you should never go into code view if you do not know what you're doing :)

Corrosive
11-14-2008, 06:10 AM
you should never go into code view if you do not know what you're doing :)

True, you don't want to mess up your business site by messing with stuff you don't understand but you have to take the 'code view plunge' at some stage and, IMHO, the sooner the better. Try building a few pages that don't matter so that you can practise.