View Full Version : Yelp!
smswetz
08-08-2008, 02:28 PM
Name's Sean here, nice to meet you all, and I look forward to learning something new at this forum, seems like a friendly little place.
So I came up with this lovely design for the company I'm working for, because they're website now is just utter crap. I figured instead of coding my usual way (a mess and unvalidated) I'd start off making it as clean and css-friendly as possible. I've run into some major issues, some common and some not. If any of you could help me, I would be extremely grateful.
My main problem is my issue with internet explorer. I've positioned everything to match up perfectly in Firefox, the site looks great and is aligned fairly well. However, when the site hits IE, everything shifts a couple pixels and throws everything off. Anyone know why this is happening? There is also a gap at the top of the page in IE, which isn't present in firefox.
I also can't figure out how to pus the footer to the bottom. I wanted another footer that stretched the whole page at the bottom (similar to the top), with a sort of 'prefooter' on top of it. I can't figure out how to just push a regular footer to the bottom, and I've tried all the fixes I can find online. Any idea why?
Here is the site:
http://www.chromaticstudios.net/AVT/
smswetz
08-08-2008, 02:29 PM
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AVT</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body>
<div id="fluid-bar"></div>
<div id="container">
<!--Menu-->
<div id="menubg">
<div id="menuitem1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('link1','','images/link1_over.jpg',1)"><img src="images/link1.jpg" name="link1" width="135" height="63" border= "0" id="link1" alt="home" /></a>
</div>
<div id="menuitem2">
</div>
</div>
<!--End Menu-->
<!--Header-->
<div id="header">
<div id="textnava">
<div id="textnavb">
link 1 | link 2 | link 3 | link 4</div>
</div>
</div>
<!--End Header-->
<!--Main Content-->
<div id="content">
<div id="main">
<div id="maincontent">
<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent sollicitudin nisl nec lorem. Vestibulum tempor pellentesque nisi. In pretium. Integer euismod leo id risus gravida ullamcorper. Curabitur interdum justo nec nisi. Vestibulum elementum adipiscing dui. Proin sed magna. Phasellus lectus libero, dapibus sit amet, tincidunt ut, scelerisque sit amet, justo. Nunc nisi risus, gravida vitae, ultricies in, lacinia sed, lacus. Nulla libero. Morbi dolor purus, dignissim eget, ornare sed, volutpat et, arcu. Praesent pharetra neque non sapien. Etiam vitae elit. Maecenas elementum semper felis. Suspendisse potenti. Nunc lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque interdum ultrices lacus. Mauris leo. Nulla lacus eros, placerat quis, eleifend sit amet, tincidunt id, eros. </p>
<p>Cras consectetuer dictum turpis. Pellentesque nunc. Proin nisi dui, dapibus at, vehicula quis, hendrerit a, nisi. Suspendisse accumsan, mauris et pulvinar porta, mauris eros gravida est, eu sodales magna risus adipiscing nibh. </p>
</div>
</div>
</div>
<div id="right">
</div>
</div>
<div id="footer"> </div>
</body>
</html>
Here is the CSS:
@charset "utf-8";
/* CSS Document */
html {
height: 100%;
}
body {
background-image:url(images/pagebg.jpg);
background-repeat: repeat-y;
background-position: center center;
background-color: #000000;
height: 100%;
}
#container {
min-height: 100%;
_height: 100%;
position: relative;
top: 10px;
padding-bottom: 40px;
}
#fluid-bar {
border: 0px;
width: 100%;
height: 20px;
position: absolute;
background-image: url(images/headerbg.jpg);
background-repeat: repeat-x;
top: 0px;
left: 0px;
}
#menubg {
border: 0px;
width: 900px;
height: 63px;
background-image: url(images/menu_bg.jpg);
margin: auto;
top: 20px;
}
#menuitem1{
border: 0px;
width: 135px;
height: 63px;
margin: auto;
top: 20px;
float: left;
}
#menuitem2{
border: 0px;
width: 135px;
height: 63px;
margin: auto;
top: 20px;
float: left;
}
#header {
margin-left: auto;
margin-right: auto;
width: 970px;
height: 270px;
background-image: url(images/avtbanner.jpg);
background-position: center center;
}
#textnava {
width: 575px;
height: 20px;
padding-left: 35px;
margin-top: 175px;
position: absolute;
}
#textnavb {
background-color: #000;
color: #FFFFFF;
width: 505px;
height: 20px;
padding-left: 150px;
padding-top: 8px;
opacity: .5;
position: absolute;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
#content {
margin-left: auto;
margin-right: auto;
width: 900px;
padding-bottom: 40px;
}
#right{
border: 0px;
width: 230px;
float: right;
padding-left: 20px;
padding-top: 4px;
padding-right: 5px;
padding-bottom: 40px;
}
#rightcontent_top{
border: 0px;
width: 220px;
height: 40px;
clear: left;
padding-bottom: 40px;
}
#main{
border: 0px;
width: 610px;
float: left;
padding-left: 15px;
padding-top: 4px;
padding-right: 5px;
padding-bottom: 40px;
}
#maincontent{
border: 0px;
width: 590px;
height: auto;
float: left;
background-image: url(images/content_center.jpg);
padding: 5px;
color:#CCCCCC;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
border-top: solid;
border-bottom-color: #444;
border-bottom-style: solid;
border-bottom-width: medium;
border-top-color: #444;
border-top-width: medium;
padding-bottom: 40px;
}
#footer {
margin-left: auto;
margin-right: auto;
margin-bottom: 0px;
width: 900px;
height: 30px;
clear: both;
background: #000000;
position: relative;
margin-top:-40px;
}
Any help would be awesome, I don't know how much I could thank you guys. I'm really trying hard to learn this thing, because I have fallen in love with what CSS can do.
TheJoshMan
08-08-2008, 04:03 PM
Place this in your CSS and it should fix the gap in the header...
*{
margin:0;
padding:0;
}
Also, this should put your footer all the way to the bottom in IE:
#footer {
width: 900px;
height: 30px;
clear: both;
background: #000000;
position: relative;
margin:40px auto 0;
}
#content {
margin-left: auto;
margin-right: auto;
width: 900px;
padding-bottom: 40px;
margin-bottom: 40px;
}
smswetz
08-08-2008, 04:27 PM
well it's on it's way now! The margin for the css made a bit of an overlap where the menu meets the top bar, I'll play around with it see what I can do. If you have any ideas how to fix that, then that would be cool as well. I appreciate the help :)
Any idea how to fix the small pixel shift in IE? I feel like it's probably because my code is an absolute mess....am I getting in too deep, do you think it'd be better for me to start over and refine the code?
TheJoshMan
08-08-2008, 05:10 PM
I do think that you may need to think about HOW you're going to layout the site BEFORE you start. That seems to be the problem alot of people have lately. They get started with only the basic idea, then they decide they want this or that and the design/coding changes and pretty soon, they have far too many divs and spans and such. I saw another post on here the other day, I can't remember where it was... But it was about "Divinitis" you should search google for it using boolean terms.
"Divinitis & CSS"
TheJoshMan
08-08-2008, 05:13 PM
I noticed in your CSS for the "Footer", you have "margin-top:" set to "-40px".
By setting it to -40px that will move the element 40px TOWARDS the top
smswetz
08-08-2008, 05:15 PM
Oh I've read it, and I will admit I have a terrible case of divinitis. I use it as a form of organization, and i always think everything needs to be in a div to add attributes to it. It's my way of thinking, and it's terrible, I know.
I started the design over in terms of coding, and it's coming alot cleaner. I'm still having that damn issue in Internet explorer, it doesn't seem to be centering the header when the page expands, and it needs a one pixel shift over, but when I do that, it looks messed up in FF at all times.
I don't win.
TheJoshMan
08-08-2008, 05:15 PM
I also just noticed that you are using a lot of "padding-top" "padding-bottom" "padding-left" and so on... I just wanted to make sure that you understand (because I got them confused until just recently), that "padding" and "margin" are different.
Padding = Empty space from edges on INSIDE of element
Margin = Empty space from edges on OUTSIDE of element
smswetz
08-08-2008, 05:18 PM
I noticed in your CSS for the "Footer", you have "margin-top:" set to "-40px".
By setting it to -40px that will move the element 40px TOWARDS the top
That was just me plugging things in just to see if it worked. Somewhere in my head it made sense :o
Thanks for the padding/margin tip, I often get those two confused.
TheJoshMan
08-08-2008, 05:19 PM
Also, there is a "shorthand" version that will save your fingers and possibly prevent you from getting carpal tunnel syndrome.
Instead of using:
padding-top:5px;
padding-right:10px;
padding-bottom:5px;
padding-left:10px;
You could use,
padding:5px 10px 5px 10px;
That would achieve the same end result. The order is always, "Top" "Right" "Bottom" "Left" when using shorthand.
smswetz
08-08-2008, 05:35 PM
Oh thank you for that, I appreciate all the help. This is tough man haha.
TheJoshMan
08-08-2008, 05:38 PM
You'll get the hang of it. CSS is pretty easy once you grasp the basic concepts
smswetz
08-08-2008, 05:42 PM
You'll get the hang of it. CSS is pretty easy once you grasp the basic concepts
Ha, I know, it just seems like you have the perfect idea for how something would work conjured up in your head, then you put it in code, and pow...it looks like crap.
smswetz
08-08-2008, 05:53 PM
If you have time, I cleaned up the code a little bit, and that damn footer is giving me issues, and I still have that shift in IE. It looks a lot better when you view the source now, but if you have time, could you just run a quick look for me? I would really appreciate it, you don't know how much this help means to me, it means I might actually enjoy my weekend :P
http://www.chromaticstudios.net/AVT/index_2.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AVT</title>
<link href="style2.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"></div>
<!--start container-->
<div id="conatiner">
<!--menu-->
<div id="menubar">
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
<div id="menuitem"> <img src="images/link1.jpg" alt="link#1" /></div>
</div>
<!--end menu-->
<!--banner-->
<div id="banner">
</div>
<!--end banner-->
<!--content-->
<div id="content">
<div id="main">
<p> </p>
</div>
<div id="right">
<p> </p>
</div>
</div>
<!--end content-->
</div>
<!--end container-->
<div id="footer"></div>
</body>
</html>
@charset "utf-8";
/* CSS Document */
body {
background-image:url(images/pagebg.jpg);
background-repeat: repeat-y;
background-position: center;
background-color: #000000;
height: 100%;
}
*{
margin:0;
padding:0;
}
#header {
border: 0px;
width: 100%;
height: 20px;
position: absolute;
background-image: url(images/headerbg.jpg);
background-repeat: repeat-x;
top: 0px;
left: 0px;
}
#container {
min-height: 100%;
_height: 100%;
position: relative;
margin-bottom: 40px;
}
#menubar {
border: 0px;
width: 900px;
height: 63px;
background-image: url(images/menu_bg.jpg);
margin: auto;
margin-top: 20px;
}
#menuitem{
border: 0px;
width: 135px;
height: 63px;
margin: auto;
top: 20px;
float: left;
}
#banner {
border: 0px;
width: 970px;
height: 271px;
background-image: url(images/avtbanner.jpg);
margin: auto;
}
#menu2{
border: 0px;
width: 500px;
height: 25px;
background-color: #000000;
margin-left: 35px;
}
#content {
margin-left: auto;
margin-right: auto;
width: 900px;
height: 100%;
padding-bottom: 20px;
margin-bottom: 20px;
}
#main {
width: 640px;
padding: 10px 10px 10px 10px;
height: 100%;
float: left;
}
#right {
width: 220px;
padding: 10px 10px 10px 10px;
height: 100%;
float: right;
}
#footer {
margin: 20px auto 0;
width: 100%;
height: 20px;
position: relative;
clear: both;
background-image: url(images/footerbg.jpg);
}
TheJoshMan
08-08-2008, 06:37 PM
Ok, two things. Here's what I came up with for the footer... I don't think this is "supposed" to work... but it did when I tested it.
footer{
margin:100% 0 0;
}
Secondly, I'm noticing that your content has seemed to have pushed your divs out of alignment. If you look closely at where the sidebar meets the background and where the content meets the sidebar, there is a small gap where the edges don't align right.
smswetz
08-08-2008, 06:44 PM
Ok, two things. Here's what I came up with for the footer... I don't think this is "supposed" to work... but it did when I tested it.
footer{
margin:100% 0 0;
}
Secondly, I'm noticing that your content has seemed to have pushed your divs out of alignment. If you look closely at where the sidebar meets the background and where the content meets the sidebar, there is a small gap where the edges don't align right.
Thanks for the footer fix, I don't care if it's not supposed to work, it does haha, it just makes the page MASSIVE...but whatever haha.
That off alignment is the pixel shift I'm talking about, I can't figure it out, it has something to do with the header (since the sidebar is created by a background image)..
TheJoshMan
08-08-2008, 06:45 PM
ah, I guess I didn't see that... I bet I know what the issue is... Let me take another look.
BRB
smswetz
08-08-2008, 06:48 PM
Thanks, and now you're a senior coder, congrats ha
TheJoshMan
08-08-2008, 06:50 PM
That is so strange... Here's what I've gathered so far.
The misalignment issue happens in IE7 at all times with current coding
However, it does not show up in FF3 until I open the panel for "FireBug"
Does anyone else know what may be causing this to happen when I open FireBug? Strange little glitch I think.
smswetz
08-08-2008, 06:55 PM
It's odd, when I have IE shrunk in size (maybe about half the size of normal browsing) it doesn't happen, but when I extend it to full size, it does happen. Don't quite understand it, do you think it could be an image problem?
TheJoshMan
08-08-2008, 07:02 PM
no... it's not the image. My first assumption is that it has something to do with the margin. However, I still can't find the problem.
smswetz
08-08-2008, 07:12 PM
hmmm it's definitely sticky, I didn't think it was going to be that complicated of a layout lol.
TheJoshMan
08-08-2008, 07:22 PM
Ok, add this to "#banner"
#banner{
padding-right:1px;
}
smswetz
08-08-2008, 07:29 PM
but now look at it in firefox, regular view :?
TheJoshMan
08-08-2008, 07:46 PM
looks fine in regular view FF to me after adding the above bit of code
smswetz
08-08-2008, 07:48 PM
hmm, thats odd, on my end it looks funky, like it's perm. shifted to the right now. It's **** confusing haha.
TheJoshMan
08-08-2008, 07:51 PM
please refrain from using curse words... replace them with **** or *$#&% or something to that effect...
Check your PM's (private messages)
smswetz
08-08-2008, 08:00 PM
My bad, fixed. Check yours, replied.
TheJoshMan
08-08-2008, 08:05 PM
wasn't trying to be demanding or mean, it's just that there are many young kids who use these forums as well... (myspace and such) UGGGHHHHHHHHH!
LOL
smswetz
08-08-2008, 08:07 PM
Oh, no, I understand man. I couldn't imagine trying to grasp myspace code being a kid, I can't even do it now haha.
TheJoshMan
08-08-2008, 08:08 PM
Yea, MySpace should have it's own definition as far as w3c standards go... It's called NONEXISTENT!
I really wish they'd just rip that eyesore of the net.
But, let's not get me started on MySpace again. Let's stick to the problem at hand.
PS-PM
Medyman
08-09-2008, 04:38 PM
I do think that you may need to think about HOW you're going to layout the site BEFORE you start. That seems to be the problem alot of people have lately. They get started with only the basic idea, then they decide they want this or that and the design/coding changes and pretty soon, they have far too many divs and spans and such. I saw another post on here the other day, I can't remember where it was... But it was about "Divinitis" you should search google for it using boolean terms.
"Divinitis & CSS"
I think you mean DIVITIS (http://csscreator.com/?q=divitis) (inflammation of the div).
TheJoshMan
08-09-2008, 06:27 PM
Ah, I knew it was something to that effect. Thanks Medyman
TheJoshMan
08-09-2008, 10:36 PM
Well, I fixed your problem... It's far to big to post on here, so whenever you get around to it, just pm me or message me on Yahoo and I'll send you the zip
smswetz
08-11-2008, 01:05 PM
Well, I fixed your problem... It's far to big to post on here, so whenever you get around to it, just pm me or message me on Yahoo and I'll send you the zip
Sorry it was a busy weekend, I just moved and I'm trying to get things in order, and the parents ended up coming up to see the apartment. I'm really sorry about not being able to get a hold of you.
I'll try and jump on meebo while at work, or if you catch me on here, send me a pm.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.