Click to See Complete Forum and Search --> : Small display error in IE


scottyrob
03-13-2007, 04:20 PM
Hi there,
Im trying to fix a display error in I.E

on www.srobinson.net in FF the main content box fills up the whole area and shows the black border, but in IE the BG for the main content box dosent fill the whole area as it misses the right side slightly

Any ideas?

Fet

Centauri
03-13-2007, 05:03 PM
Apparently, you did not read my reply to this post (http://www.webdeveloper.com/forum/showthread.php?t=139703) ???

scottyrob
03-13-2007, 05:10 PM
Well as it is a personal site and everyone that I know will be viewing it will be viewing it in a higher res than 1024 * 768. If they are viewing it in a res of less than 1024 * 768 then they wont be able to view the site correctly! That solves my first problem

Centauri
03-13-2007, 05:29 PM
And what about the "absolute mess of unnecessary absolutely positioned divs and huge graphic files" I mentioned, as well as no doctype ? - all of which is guaranteed to cause problems (especially with IE).

It seems as though you are getting away from using tables by setting up divs to exactly copy a table layout - which is no better....

Cheers
Graeme

scottyrob
03-14-2007, 04:27 AM
How else would you go about this then? This is the first site ive made in photoshop and ive just sliced them up and it automattically uses CSS (Divs or Classes) or tables to position the content. I understand that there are a few to many on the navigation bar but how would i go about doing the rest?

Scott

Centauri
03-14-2007, 07:36 AM
Ahh - Photoshop slice and dice. Possibly the worst way to make a site....:)

Start by looking at CONTENT, then look at styling that content to get the look you want. Using Photoshop to work out a visual look is fine, but use selected graphic elements rather than slicing the whole lot. Attached is a zip file of reworked graphics I used - all the gradients and botton graphics are only 1 pixel wide, the logo graphic has been widened to allow for a fluid site, and the graphics have been optimised to jpegs to reduce file sizes. Only 5 graphics totalling 16k are required.

Thinking of content, the html can consist of a simple unordered list for the menu links, a <h1> header for the page logo (don't worry, will be styled soon), and a div for content. With two overall wrapper divs to hold the various graphics, and a valid html 4.01 strict doctype, the html can be as simple as <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SRobinson.net</title>
<link href="sr.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="outerwrap">
<div id="innerwrap">
<ul id="navbar">
<li><a href="index.php?page=contact">Contact</a></li>
<li><a href="index.php?page=guestbook">Guestbook</a></li>
<li><a href="index.php?page=portfolio">Portfolio</a></li>
<li><a href="index.php?page=blog">Blog</a></li>
<li><a href="index.php?page=home">Home</a></li>
</ul>
<h1>SRobinson.net</h1>
<div id="content">
<p>Content</p>
</div>
</div>
</div>
</body>
</html>

If you look at this so far, it isn't very spectacular visually, but is completely accessible and understandable by screen readers, search engine spiders etc. Also note the reversed order of the links - as the links will be at the right side of the page, we will float them right so the first float will be the furthest right.

Styling in next post

Centauri
03-14-2007, 07:59 AM
The sr.css file is as follows :* {
margin: 0;
padding: 0;
}
body {
background-color: #273038;
background-image: url(images/grad_back.jpg);
background-repeat: repeat-x;
color: #EEEEEE;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
p {
padding: 10px 0;
}
#outerwrap {
margin: 4% 8% 0;
background-color: #273038;
background-image: url(images/grad_back.jpg);
background-repeat: repeat-x;
padding: 12px 12px 0;
}
#innerwrap {
background-color: #181E23;
border-left: 2px solid #181E23;
border-right: 2px solid #181E23;
}
#navbar {
display: block;
height: 65px;
background-image: url(images/menu_back.jpg);
background-repeat: repeat-x;
}
#navbar li {
list-style: none;
float: right;
}
#navbar a {
display: block;
width: 120px;
height: 65px;
text-decoration: none;
text-align: center;
line-height: 65px;
color: #C8D2DA;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-image: url(images/menu_back.jpg);
background-repeat: repeat-x;
}
#navbar a:hover {
color: #333333;
background-image: url(images/menu_over.jpg);
}
h1 {
display: block;
height: 56px;
font-size: 1px;
text-indent: -1000px;
background-image: url(images/logo_back.jpg);
background-position: right top;
}
#content {
min-height: 400px;
background-image: url(images/cont_back.jpg);
background-repeat: repeat-x;
padding: 0 15px;
}
* html #content {
height: 400px;
}


At the start of the css, I have zeroed the browser default element margins and padding for cross-browser uniformity - a default padding is subsequenty applied to p paragraph tags. The body styling has the base text font and size as well as the repeated gradient background.

The #outerwrap div defines the size of the site using percentage margins only, allowing the site to adapt to different screen resolutions - even 800x600. The same gradient background as the body is used, and the positioning provides visual separation. The #innerwrap div sits inside the #outerwrap spaced by #outerwrap's padding (12px top and sides) which gives the impression of gradient borders.

The navigation <a> links are styled as block elements and given an appropriate size. They are also given a repeated 1 pixel wide background. The line-height specification centres the text in the links vertically. The navigation <li>s are then floated right, which stacks the link blocks to the right side. The list-style:none removes the standard list bullets. The navigation <ul> is then displayed as a block, given a height (as it collapses due to the floats), and given the same background as the buttons to complete the bar full site width. I also did a rollover graphic which is implemented with the a:hover css.

Following this, the <h1> header is styled as a 56px high block and given the logo background, positioned right to allow for resizing. The <h1> text itself is reduced to 1 pixel height and indented off the left of the page so it cannot be seen (visually - screen readers can still read it).

All this is followed by the content div, with again a 1 pixel wide gradient repeated background. This is set to at least 400px high via the min-height setting, but as IE6 doesn't understand this, the * html #content css feeds it the fixed 400px height (IE will incorrectly expend this with content).

And there it is - simpler, quicker loading, more accessible and no javascript.

Cheers
Graeme

scottyrob
03-14-2007, 06:08 PM
Hi there,
Im just playing with the code you gave me.. Do you think theres any chance you could redo those images for me as there rather low quality and linear? Id still like them small but preferably smoother...

Thanks for that, im just in the middle of figuring all of that out :)

Centauri
03-14-2007, 07:42 PM
These any better?

WebJoel
03-14-2007, 08:19 PM
You probably won't listen to me either ( :) ), I seem to recall viewing this site before and offering suggestions, -but here is a quickie 20-minute re-do of your site, better. :D Maybe from this you can get some ideas. :)