Current location: Hot Scripts Forums » General Web Coding » CSS » Internet Explorer and List Tags


Internet Explorer and List Tags

Reply
  #1 (permalink)  
Old 12-21-06, 01:51 PM
tophat's Avatar
tophat tophat is offline
Newbie Coder
 
Join Date: Dec 2005
Location: Michigan
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow Internet Explorer and List Tags

I've tried multiple solutions to this, but none seem to work. The page looks fine in Mozilla Firefox, but when viewed in IE, the first line of the list tag is indented. If you have any solutions/suggestions, please tell me

http://tophatcomedy.com/6/new.html
http://tophatcomedy.com/6/default.css
__________________
tophatcomedy.com
Reply With Quote
  #2 (permalink)  
Old 12-21-06, 03:36 PM
Shaffer Shaffer is offline
Wannabe Coder
 
Join Date: Sep 2006
Location: Israel
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
I don't see the problem. What line has a problem?

Shaffer.
__________________
Hello from Israel!
Reply With Quote
  #3 (permalink)  
Old 12-21-06, 04:35 PM
tophat's Avatar
tophat tophat is offline
Newbie Coder
 
Join Date: Dec 2005
Location: Michigan
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
notice where the blue gradient (middle-right) area is, the first line is indented while the others are not (only in IE), while in mozilla it looks fine.
__________________
tophatcomedy.com
Reply With Quote
  #4 (permalink)  
Old 12-21-06, 05:37 PM
Alan+61415484049 Alan+61415484049 is offline
Newbie Coder
 
Join Date: Dec 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Brahms and Lists !

I had a (very) quick look at the code.

It appears that you haven't suggested a style for the paragraph element <p>.

Try removing the <p> from inside the list element <li>.

Web browsers are intelligent software (exception - Microsoft Internet Explorer).

They've parsed your <li> and decided there must be a <ul> or an <ol> even though they haven't found one.

I think that IE has moved your top line to accommodate the default bullet that visual browsers render preceding each list item.

May I suggest the following?

1) Style the list with a <ul>, absent from your CSS.

2) Put each list-item within this list element.

3) Re-code the page so that the unordered list <ul> is not contained within a table.

4) Importantly, check your CSS!

You've styled <div.news> with list-style-type: none

In HTML 4.0, list-style-type is a property that only applies to
elements with the Display Value of list-item -<li>

Here's a suggestion for the style sheet:

Code:
     .news ul 
     {
align: center;
text-decoration: none;
list-style-type: none;
margin: 0px 0px;
padding: none;
     }
And here's a suggestion for the HTML:

Code:
<ul class="news">
<li>News News News</li>
<li>News News News</li>
<li>News News News</li>
   </ul>
*********
BTW

Using tables to layout a page isn't recommended - tables are used to hold tabular data, despite what the good folks at Dreamweaver say.

The problem with using tables for layout is that a browser must download ALL of the table before it can start rendering the page.

And of course your HTML won't be littered with <td>'s and <tr>'s, simplifying the editing of the document, which is another reason to use CSS!

*********

Last edited by Alan+61415484049; 12-21-06 at 06:19 PM.
Reply With Quote
  #5 (permalink)  
Old 12-21-06, 06:49 PM
Alan+61415484049 Alan+61415484049 is offline
Newbie Coder
 
Join Date: Dec 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Here's a further suggestion for the style sheet:

Code:
     .news ul 
     {
align: center;
text-decoration: none;
list-style-type: none;
margin: 0px 0px;
padding: none;
     }
And here's a suggestion for the HTML:

Code:
<ul class="news">
<li>News News News</li>
<li>News News News</li>
<li>News News News</li>
   </ul>
Reply With Quote
  #6 (permalink)  
Old 12-21-06, 06:54 PM
Alan+61415484049 Alan+61415484049 is offline
Newbie Coder
 
Join Date: Dec 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
OOps! I forgot to check my CSS, so here it is with the correct property name text-align and no text-decoration.

Code:
     .news ul 
     {
text-align: center;
list-style-type: none;
margin: 0px 0px;
padding: none;
     }
And here's a suggestion for the HTML:

Code:
<ul class="news">
<li>News News News</li>
<li>News News News</li>
<li>News News News</li>
   </ul>
Reply With Quote
  #7 (permalink)  
Old 12-21-06, 08:18 PM
tophat's Avatar
tophat tophat is offline
Newbie Coder
 
Join Date: Dec 2005
Location: Michigan
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you, I appreciate your help.

The only thing is I don't think I'm going to re-do the design because of a first line indention. If I used ul or ol, it would indent everything, and that's worse than just one line. I honestly just prefer tables over div tags, simply because it's just the way I learned . I do think I'll take your idea of removing the <p> tag, as that may help.

I am also considering recommending all my visitors to use Firefox, basically because I'm sick of IE and Firefox differences, and prefer Firefox anyways.

Anyways, thanks again for your help.
__________________
tophatcomedy.com

Last edited by tophat; 12-21-06 at 08:21 PM.
Reply With Quote
  #8 (permalink)  
Old 12-26-06, 04:14 PM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by tophat
If I used ul or ol, it would indent everything, and that's worse than just one line.
That's the whole point of stylesheets. You can control the indent! It's as simple as something like:
Code:
ul {
margin:0;
padding:0; /*maybe not needed? not sure offhand... */
}
Also, an <li> element is a list item. The <ol> and <ul> elements are ordered/unordered lists. It doesn't make much sense to have a list item that is not part of a list, right? If you're not making a list, then maybe you should just use <p> paragraphs?


Quote:
Originally Posted by tophat
I am also considering recommending all my visitors to use Firefox, basically because I'm sick of IE and Firefox differences, and prefer Firefox anyways.
Wouldn't it be nice if everyone did that ? But keep in mind that if you don't support IE, you won't be supporting a LOT of people. If it's only a minor layout issue, to heck with it, but if prevents use of your site - it might be time to rethink the game plan.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Favorites list Fyrebryd01 Visual Basic 0 04-14-04 12:58 PM


All times are GMT -5. The time now is 01:58 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.