Website woes, HELP!

All your computer hardware and software questions in here please.

Moderator: Moderators

Post Reply
User avatar
Mooncat
Senior Member
Posts: 11466
Joined: Sun Dec 23, 2007 4:11 pm
Location: Wales
Has thanked: 81 times
Been thanked: 72 times

Website woes, HELP!

Post by Mooncat »

I am writing a website for myself, and getting several unexplained problems.

I've uploaded some files so you can see what I mean:

http://astrocat.exactpages.com/home.htm



Look at Home, Restoration, and Feedback (none of the other links are uploaded). The link colours seem wrong, though they don't change at all at home with all files on my computer. On the feedback page, the form is supposed to be in the content area, not over the footer, and unless I press F11 I can't see all of it, though I can in Dreamweaver design view. Neither do the link colours chang on this page.

and the stylesheet This is my first-ever attempt at CSS.

@charset "utf-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #DDDDDD;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.twoColLiqLtHdr #container {
width: 1000px; /* this will create a container 100% of the browser width */
background: #DDDDDD
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 0px solid #000000;
text-align: center; /* this overrides the text-align: center on the body element. */
}
.twoColLiqLtHdr #header {
background: #DaDaDD;
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColLiqLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
border:dashed;
border-color:#003399;
border-width:medium;
}

/* Tips for sidebar1:
1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.twoColLiqLtHdr #sidebar1 {
float: none;
width: 24%; /* since this element is floated, a width must be given */
background: #DDDDDD; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
margin-left: 30px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 10px;
}
table {
position: fixed;
margin-left: 50px;
border: 0;
font-family: arial;
font-size:14px;
margin-bottom: 500px;


}
th
{
font-family: arial;
font-size:14px;
background: white;
margin-left: 15px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
margin-bottom: 10px;
}
td
{
font-family: arial;
font-size:14px;
background: white;
margin-left: 25px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 5px;
margin-bottom: 10px;
}
a
{
float:none;
width:12em;
text-decoration:none;
color:blue;
padding:0.2em 0.2em;
border-right:0px solid white;
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight:bold;
}
a:link {
color:#0000A0;
text-decoration:none;}
a:visited {
color:#254117;
text-decoration:none;}
a:active {
color:#000000:
text-decoration:none;}
a:link:hover {
color:#006699
background-color:#E42217;
text-decoration:none;}
li
{
display:inline;
}
/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.twoColLiqLtHdr #mainContent {
margin: 0 20px 0 26%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
background:#DDDDDD;
}
.twoColLiqLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColLiqLtHdr #footer p {
margin-top: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
height:200px; width:inherit;
margin-bottom: 20px;
}





.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
font-style: normal;
color: #CC99FF;


}
I started out with nothing, I still have most of it.

Directmail scam information site: http://astrocat.proboards.com/index.cgi?
User avatar
Gadget
Jack Of All Trades
Posts: 8004
Joined: Sun Dec 18, 2005 9:23 pm
Location: Whitley Bay
Has thanked: 344 times
Been thanked: 342 times

Post by Gadget »

Just click on the thingy and then select wotsits from the drop-down menu!
By eck! ©
jez69
Newly registered Member
Posts: 18
Joined: Wed Mar 24, 2010 12:32 pm
Has thanked: 0
Been thanked: 0

Post by jez69 »

Hi Keith,

Well that's a big mess and no mistake. Don't worry, I'm sure it's not entirely down to you. :-)

Right, I've had a scan through the source code and between Dreamweaver and your web host there's a whole bunch of stuff in there fogging up the issue.

You'll have to bear with me; I do web pages by hand with a text editor so I've got to have my rant about the bloated code these WYSIWYG web editors generate.

Right, I've got that off my chest now so we can continute. :wink:

First up there are a couple of errors in your CSS. A few lines are either missing the semi-colon at the end or have a colon instead. This is why you're not getting the link colours you were expecting.

Next - in the HTML code for the page itself (I'm looking at feedback.htm):
The <script> tag on line 15 never gets closed and then on line 30 there's a whole bunch of closing tag that have never been opened: </noscript></div></xmp></style>

Adding a line just above line 30 that closes the script tag (</script>), open the <noscript> tag and then delete </div></xmp></style>
then that should straighten that out.

Next - lines 38 to 74 we have HTML display code (namely a table) that is in the <head> element which it shouldn't be. Also at the end of line 74 we have a </script> with no matching <script> before it - maybe a hangover from the one on line 15?

Anyway - I've sorted all this lot out and it's still not fixed the floating form issue. I will have another look a little later and see if I can't beat it into submission.

For now, here's the fixed and prettified CSS

Code: Select all

@charset "utf-8";
body {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #DDDDDD;
	margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
	padding: 0;
	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
	color: #000000;
}
.twoColLiqLtHdr #container {
	width: 1000px; /* this will create a container 100% of the browser width */
	background: #DDDDDD;
	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
	border: 0px solid #000000;
	text-align: center; /* this overrides the text-align: center on the body element. */
}
.twoColLiqLtHdr #header {
	background: #DaDaDD;
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColLiqLtHdr #header h1 {
	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
	border:dashed;
	border-color:#003399;
	border-width:medium;
}
/* Tips for sidebar1:
1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.twoColLiqLtHdr #sidebar1 {
	float: none;
	width: 24%; /* since this element is floated, a width must be given */
	background: #DDDDDD; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
	margin-left: 30px; /* the left and right margin should be given to every element that will be placed in the side columns */
	margin-right: 10px;
}
table {
	position: fixed;
	margin-left: 50px;
	border: 0;
	font-family: arial;
	font-size:14px;
	margin-bottom: 500px;
}
th {
	font-family: arial;
	font-size:14px;
	background: white;
	margin-left: 15px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 10px;
	margin-bottom: 10px;
}
td {
	font-family: arial;
	font-size:14px;
	background: white;
	margin-left: 25px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 5px;
	margin-bottom: 10px;
}
a {
	float:none;
	width:12em;
	text-decoration:none;
	color:blue;
	padding:0.2em 0.2em;
	border-right:0px solid white;
	font-family:Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight:bold;
}
a:link {
	color:#0000A0;
	text-decoration:none;
}
a:visited {
	color:#254117;
	text-decoration:none;
}
a:active {
	color:#000000;
	text-decoration:none;
}
a:link:hover {
	color:#006699;
	background-color:#E42217;
	text-decoration:none;
}
li {
	display:inline;
}
/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.twoColLiqLtHdr #mainContent {
	margin: 0 20px 0 26%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
	background:#DDDDDD;
}
.twoColLiqLtHdr #footer {
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#DDDDDD;
}
.twoColLiqLtHdr #footer p {
	margin-top: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
	height:200px;
	width:inherit;
	margin-bottom: 20px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
	clear:both;
	height:0;
	font-size: 1px;
	line-height: 0px;
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	font-style: normal;
	color: #CC99FF;
}
jez69
Newly registered Member
Posts: 18
Joined: Wed Mar 24, 2010 12:32 pm
Has thanked: 0
Been thanked: 0

Post by jez69 »

Found it! :lol:

In the CSS, you have defined tables as "position: fixed;" which makes them float above the page. If you take this out then the page flows around them again, but you now see the effects of the "margin-bottom: 500px;", so best take this out too.

Finally, having done all this, the left menu no longer sits properly, so .twoColLiqLtHdr #sidebar1 has to be told to "float: left;"

It's starting to get there, but still leaves a little to be desired.

I've put the CSS below again.

I have to say that, thanks to the illusion of "easily create your own web pages with no programming required" that things like Dreamweaver give, you've really jumped (or been pushed) into the deep end.

Personally, I think you'd be far better off finding an ISP that offers website templates that you can populate with a content management system. Although there are loads of open source CMS out there that were suggested in your other thread (I use http://modxcms.com/ when I need to), I wouldn't recommend trying to install one for yourself because you still need web developer and design skills to configure them how you want them.

On the other hand, you've managed to get this far...

Code: Select all

@charset "utf-8";
body {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #DDDDDD;
	margin: 0;
	padding: 0;
	text-align: center;
	color: #000000;
}
table {
	margin-left: 50px;
	border: 0;
	font-family: arial;
	font-size:14px;
}
th {
	font-family: arial;
	font-size:14px;
	background: white;
	margin-left: 15px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 10px;
	margin-bottom: 10px;
}
td {
	font-family: arial;
	font-size:14px;
	background: white;
	margin-left: 25px;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 5px;
	margin-bottom: 10px;
}
a {
	float:none;
	width:12em;
	text-decoration:none;
	color:blue;
	padding:0.2em 0.2em;
	border-right:0px solid white;
	font-family:Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight:bold;
}
a:link {
	color:#0000A0;
	text-decoration:none;
}
a:visited {
	color:#254117;
	text-decoration:none;
}
a:active {
	color:#000000;
	text-decoration:none;
}
a:link:hover {
	color:#006699;
	background-color:#E42217;
	text-decoration:none;
}
li {
	display:inline;
}
.twoColLiqLtHdr #container {
	width: 1000px;
	background: #DDDDDD;
	margin: 0 auto;
	border: 0px solid #000000;
	text-align: center;
}
.twoColLiqLtHdr #header {
	background: #DaDaDD;
	padding: 0 10px;
}
.twoColLiqLtHdr #header h1 {
	margin: 0; 
	padding: 10px 0;
	border: dashed;
	border-color:#003399;
	border-width:medium;
}
.twoColLiqLtHdr #sidebar1 {
	float: left;
	width: 24%;
	background: #DDDDDD; 
	padding: 15px 0;
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
	margin-left: 30px; 
	margin-right: 10px;
}
.twoColLiqLtHdr #mainContent {
	margin: 0 20px 0 26%;
	background:#DDDDDD;
}
.twoColLiqLtHdr #footer {
	padding: 0 10px; 
	background:#DDDDDD;
}
.twoColLiqLtHdr #footer p {
	margin-top: 0;
	padding: 10px 0;
	height:200px;
	width:inherit;
	margin-bottom: 20px;
}
.clearfloat {
	clear:both;
	height:0;
	font-size: 1px;
	line-height: 0px;
	font-size: 14px;
	font-family: Arial, Helvetica, sans-serif;
	font-style: normal;
	color: #CC99FF;
}
Post Reply

Return to “Computers”