Jump to content

Website - CSS layout problem


Darkelve
 Share

Recommended Posts

I am working on a test page for our corporate web site. The problem is, in Internet Explorer, there is this really annoying grey bar on top, seems like something is "pushing down" another element. But I can't figure out what exactly is happening :wall:

 

The guys who designed the site said this was caused (on other pages there was this problem as well) by a rendering problem in Explorer, but that -if you take away the doctype- it should be fine. So I took it away but the grey bar is still there!

 

This is the page:

http://www.delijn.be/infopdf/popuppdf3_test.asp

 

And this is the page with a sample argument (searching for a timetable)

http://www.delijn.be/infopdf/popuppdf3_tes...4&maand=8&dag=5

 

I need a fix... :wall: but an explanation on what is going on here would be even better.

 

Darkelve

 

 

Oh yeah, it could come in handy to activate your pop-up blocker for this testpage.

Edited by Darkelve
Link to comment
Share on other sites

Guest Adriano

Point 1. I see your problem in IE 6 updated.

Point 2. If you don't put a doctype it'll be much harder to solve this. Please choose one or at least tell us which one it was (that way I can reproduce this in my PC without modifying your test site.

Point 3. What's this bit for (in the "top" div): <h6> </h6> ?

Point 4. Adding <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> to your page fixed this problem (and a few other bugs I was seeing, such as the "Ga naar uw province" yellow search box to the right).

 

So your problem seems to be that without a doctype (or with a badly entered one) your page caused IE to enter "Quirks mode", which is a way of saying "Let's interpret these pages in ugly ways and cause unintended results!".

I do not know if the best doctype for you is XHTML 1 strict. If this is indeed not the case, we'll try something else.

 

This doesn't take into account IE 5.5, 5.0 and previous, which are also a pain to deal with. Tell us if you still see the problem in those after the change.

Edited by Adrianovaroli
Link to comment
Share on other sites

Guest Adriano

Two more things: I tested with the 4.01 transitional and strict doctypes, and with the XHTML 1.0 transitional, and the bug doesn't show up. And also, the background on the top right (the dark gray on light gray "DeLijn logos) do not show up in Opera. Why?

Link to comment
Share on other sites

Doctype added.

 

Doctype is:

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

 

the line <h6> </h6> is something I added to test something, since the text in the line that was originally there sometimes "shone through" the background. I put the   there because I feared leaving it empty might distort the layout of the page. The original line was:

 

<h6>background - rechts</h6> (translated: background - right)

 

I'm not really sure what its purpose is. I'll see if I can find anything about that in the documentation.

 

And also, the background on the top right (the dark gray on light gray "DeLijn logos) do not show up in Opera

Unfortunately, I can't use Opera at work... are you saying it is like that on all pages, or just this one?

Edited by Darkelve
Link to comment
Share on other sites

Guest Adriano

Ok, looking with IE 6, I don't see the bug anymore. So congrats. And the opera thing was just a mind typo: it's just my local copy that hadn't downloaded it. Your website looks fine now.

Link to comment
Share on other sites

Hmmm... its good when you just type the address

http://www.delijn.be/infopdf/popuppdf3_test.asp

 

But it screws up once you specify arguments:

http://www.delijn.be/infopdf/popuppdf3_tes...4&maand=8&dag=5

 

So the problem must be in the extra code used to generate the list.

 

 

Normally, the whole site in valid xhtml trans... that is, if no errors sneaked in some of the pages while maintaining it. It's a dream to work with, but it *does* need maintenance. It's easy to type a <br> instead of <br /> or put <option selected > in abbreviated form.

Edited by Darkelve
Link to comment
Share on other sites

Here's the asp code.

 

I notice an ugly div right below the <h1> tag with an embedded style rule, maybe that's the problem? Perhaps the horizontal scrollbar will go away as well then if that's cleaned up.

 

By the way, thanks for the help, I appreciate it.

 

 

 

Edit: seems like the <div> tags and style rules where placed there to control the margin. I don't think they are needed, but it seems a little odd how the page looks when it's gone. I suspect it would be easier to delete them and find the real cause why the page doesn't display as it should.

Edited by Darkelve
Link to comment
Share on other sites

Guest Adriano

Ok, I validated both pages again. The homepage is still valid, the other page has a number of mistakes, so you should go to the validator.w3c.org and check it. The errors reported? They follow. But I also noticed something different: the first line of the buggy page is this:

 

<!--D:\Inetpub\wwwroot\websitedelijn\infopdf\pdf\antw\STADBUS\4--><!--D:\Inetpub\wwwroot\websitedelijn\infopdf\pdf\antw\STADTRAM\4--><!--D:\Inetpub\wwwroot\websitedelijn\infopdf\pdf\antw\STREEK\4-->

 

And this doesn't show up on the homepage. This is followed by the doctype declaration, which seems right.

 

Now for the validation errors:

 

Below are the results of attempting to parse this document with an SGML parser.

 

Line 7, column 73: character data is not allowed here

 

...e" content="text/html; charset=iso-8859-1" />

 

You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).

 

 

Line 11, column 21: required attribute "TYPE" not specified

 

<style media="screen">@import url(../css/stijl.css); @import url(../css/planner.

 

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

 

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

 

 

Line 12, column 20: required attribute "TYPE" not specified

 

<style media="print">@import url(../css/stijl.css); @import url(../css/planner.c

 

 

Line 14, column 35: character data is not allowed here

 

<meta name="keywords" content=" " />

 

 

Line 88, column 16: required attribute "TYPE" not specified

 

<script>

 

 

Line 88, column 16: start tag for "LI" omitted, but its declaration does not permit this

 

<script>

 

 

Line 97, column 3: document type does not allow element "LI" here; missing one of "UL", "OL", "MENU", "DIR" start-tag

 

<li><A HREF='pdf/antw/STREEK/4/1901050804.pdf'>pdf 1</A></li>

 

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

 

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

 

 

Line 102, column 4: end tag for "LI" omitted, but its declaration does not permit this

 

</ul>

 

 

Line 88, column 9: start tag was here

 

<script>

Link to comment
Share on other sites

Guest Adriano

Yes, This doesn't surprise me. Sometimes you'll find that the solution to your problem is unexpected, non obvious and completely random. I call it "windowizing": solving problems by random stabs at it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...