iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old June 18th, 2007, 01:14 PM   #1
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Wink Padding difference between IE6 FF using lists

Hi ya
I am having this small problem when I turn an unordered list into a horizontal navigation. When I add padding to the container the list sits in Firefox displays it with more padding than specified IE6 seems to be fine. It gives 10px padding whilst FF gives 30px. Any help yes please.

html:
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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>horizontial list</title>
<link href="css/global02.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="topnav">
  <ul>
    <li><a href="#">Item 1</a></li>
    <li><a href="#">item 2</a></li>
    <li><a href="#">item 3</a></li>
  </ul>
</div>
</body>
</html>
CSS
Code:
body {
 color: #000000;
 background-color: #FFFFFF;
 font-family: Verdana, Arial, Helvetica, sans-serif;
}
#topnav {
 background-color: #CCCCCC;
 height: 50px;
 width: 430px;
 padding: 10px;
}
#topnav li {
 list-style-type: none;
 padding-left: 30px;
 font-size: 12px;
 display: inline;
}
#topnav li a {
 color: #0099CC;
 font-weight: bold;
 text-decoration: none;
}
#topnav li a:hover {
 color: #0099CC;
 font-weight: bold;
 text-decoration: underline;
}
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 18th, 2007, 01:17 PM   #2
Elite Veteran
 

Join Date: Jan 2007
Location: You know where
Age: 32
Posts: 4,608
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all
Re: Padding difference between IE6 FF using lists

So ... which one is right!?! The IE6 one or FF?

Nevermind ... I really do need to learn how to read the whole post

the <ul> element has margins and padding set by default, just like every other element

Code:
#topnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
 }

Last edited by karinne; June 18th, 2007 at 01:20 PM..
karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 18th, 2007, 02:19 PM   #3
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: Padding difference between IE6 FF using lists

Thanks so much Karrinne. I had tried that approach on #topnav li and it did not work so i just got frustrated!
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 18th, 2007, 03:08 PM   #4
Reputable Member
 
BGarner's Avatar
 

Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 BGarner is on a distinguished road
Re: Padding difference between IE6 FF using lists

I always include this code in every CSS...

Code:
* {
margin: 0;
padding: 0;
}
That will get rid of all default padding and margins.
BGarner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 18th, 2007, 05:21 PM   #5
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: Padding difference between IE6 FF using lists

Quote:
Originally Posted by BGarner View Post
I always include this code in every CSS...

Code:
* {
margin: 0;
padding: 0;
}
That will get rid of all default padding and margins.
Ta - is that cross browser compatible? seems to work in IE6 and FF 1.5 how about IE7, Safari and earlier browsers etc..
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 19th, 2007, 08:34 AM   #6
Elite Veteran
 

Join Date: Jan 2007
Location: You know where
Age: 32
Posts: 4,608
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all
Re: Padding difference between IE6 FF using lists

I starting to advise against the use of the universal selector:

No Margin For Error and scroll down 'til you get to Global White Space Reset


karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 19th, 2007, 12:48 PM   #7
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: Padding difference between IE6 FF using lists

Karinne what is Global White Space Reset. The link does not work. ta
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 19th, 2007, 12:59 PM   #8
Elite Veteran
 

Join Date: Jan 2007
Location: You know where
Age: 32
Posts: 4,608
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all
Re: Padding difference between IE6 FF using lists

LMAO!!!! That's really sucks for the search-this.com peeps!

Anywho ... the Global White Space Reset is basically just the use of the universal identifier - * - in the CSS to apply certain properties to ALL elements.

So ... something like

Code:
* {
   margin: 0;
   padding: 0;
}
like BGarner showed you will remove all margins and padding from every element you use in your document. And then you can specifically put what you want.

The problem comes with the submit button of a form. You'll notice that every platform/OS/browser has there own default submit button style. Most have the really plain and ugly looking

ugly-button.jpg

well ... the code above will remove the shaded look of the button and there is absolutely no way to return to that for using CSS.

Hopefully the link will come back online soon 'cause my explanation just doesn't do it justice but it's the jist of it.
karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 19th, 2007, 01:35 PM   #9
WebForumz Member
 

Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 cyberseed is on a distinguished road
Re: Padding difference between IE6 FF using lists

So if you are not using a form its ok to use it. Is there any other major downsides. For some reason I have not used * much in css (I can remember using it in dos) I shall try and find some tutorials on some useful variations. Followed you signature link last night and I thought some of the resources and tutorials were great. Cheers
cyberseed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 19th, 2007, 01:41 PM   #10
Elite Veteran
 

Join Date: Jan 2007
Location: You know where
Age: 32
Posts: 4,608
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all karinne is a name known to all
Re: Padding difference between IE6 FF using lists

Ah ... the link works now ... there's a bit more to it than that so just go and read the article
karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
difference , padding


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

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
font difference IE7 and the others stupid dog HTML, XHTML and CSS 1 August 24th, 2007 04:53 PM
whats the difference acrikey Other Languages 1 April 5th, 2007 06:37 AM
The difference moshe The Café 4 January 28th, 2007 03:52 PM
Php . asp, asp net difference maksinx PHP 3 August 15th, 2006 06:39 AM
Date Difference ekendricks Classic ASP 4 August 22nd, 2003 06:19 AM


Search Engine Optimization by vBSEO 3.2.0 RC8