Im having this problem with my web design.

Check out this site where I uploaded it

Problem is, the side bar's last 3 divs where visible both on OPERA and MOZILLA FIREFOX. However, when I tried it own Internet Explorer 7, this three divs where hidden, Why is this? Does anyone here have a solution for this?

Dani AI

Generated

Short, practical checklist to diagnose why IE7 hides the last three sidebar divs (while Firefox/Opera show them).

was right to point at the form and stylesheet as starting points, and correctly pushed back on the attribute claim. The typical causes that explain this cross-browser difference are: malformed HTML (unclosed tags), DOCTYPE/quirks-mode differences, float containment (parent not containing floated children), stacking/positioning differences, or IE7’s layout quirks.

Try these steps in order:

  • Validate the page HTML to catch unclosed tags and structure problems (this often explains why IE behaves differently): https://validator.w3.org/.
  • Confirm a standards DOCTYPE is present so IE is not in quirks mode.
  • Use IE/modern developer tools to inspect the DOM and computed styles for the missing divs. Temporarily give the missing elements contrasting background or borders to see where they are and whether they have size.
  • Look for float/clear problems or an overlapping positioned element with high z-index. If the sidebar children are floated but the parent does not contain them, later elements can overlap or disappear in IE.

Quick CSS fixes to try (apply to the sidebar container):

/* cause the container to contain floated children in IE6/7/modern browsers */
.sidebar { overflow: auto; zoom: 1; }

/* simple clearing element after floats (quick test) */
<div style="clear: both;"></div>

Notes and cautions: zoom:1 is an IE proprietary layout trigger — useful for debugging/fixes but prefer a standards clearfix or proper layout for production. If these steps do not reveal the issue, post the page DOCTYPE plus the relevant HTML fragment and the sidebar stylesheet so a targeted diagnosis can be made.

Recommended Answers

All 3 Replies

The id attribute is required in a form tag in XHTML, the name attribute is required in the form tag in HTML. You have neither in the form in the last div displayed.

The id attribute is required in a form tag in XHTML, the name attribute is required in the form tag in HTML. You have neither in the form in the last div displayed.

XHMTML id is NEVER required. name isn't required for form elements ( or even fields ) in HTML. It's optional. Not every form needs a name or id; not every form is necessarily accessed via javascript/CSS etc. Even if every form was accessed by javascript/CSS, it wouldn't need a name or id. id is always optional; it's defined in the XHTML core module for all elements as optional; as far as I know, so is name in HTML.

http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_XHTML_Common_Attribute_Definitions
http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#sec_F.3.4.

If you can't read DTD, these are the relevant fragments from the XHTML DTD with commentary:

<!ENTITY % id.attrib
     "id           ID                       #IMPLIED"
>
( id.attrib is a DTD parameter entity in the syntax for an optional [ implied ] attribute, of type ID with name 'id' )
...
<!ENTITY % Core.attrib
     "%XHTML.xmlns.attrib;
      %id.attrib;
      %class.attrib;
      %title.attrib;
      xml:space    ( preserve )             #FIXED 'preserve'
      %Core.extra.attrib;"
>
( The id attribute is 'copied' into a list of core attributes; later, core attributes is copied into a list of 'common' attributes, but, take my word for it, I'm not gonna copy that one )
...

<!ATTLIST %form.qname;
      %Common.attrib;
      action       %URI.datatype;           #REQUIRED
      method       ( get | post )           'get'
      enctype      %ContentType.datatype;   'application/x-www-form-urlencoded'
>

( The 'common attributes' [ which contains 'core attributes' ] are copied into the attribute list for form, where other, form-specific attributes are added, notice, only one if them is 'required', the rest have non-fixed default values ).

Thus - id is optional in forms.

Sorry that's a little off topic and absolutely useless to the OP... but.. so was your comment; and it really needed correcting.

Then this guidebook I have is wrong. It says that name is required in HTML, id is required in HTML.

Sorry about that. It was the only thing I could find that looked out of place.

The only other thing I can think of is that I have occasionally had IE render two things in the same place, hiding one if them.

It would help to see the stylesheet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.