|
|
 |
| CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the CSS Cascading Style Sheets section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |
|

March 10th, 2005, 06:38 AM
|
|
Authorized User
|
|
Join Date: Mar 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
CSS Menu problem
if you look @ http://84.30.32.166/eadtu_conf2005/
my first effort to get away from table design
so far so good, but one problem
there's a menu on the left that contains a div with the id "menu"
inside the div is a unordered list with 12 links containing rollovers
viewing with mozilla / firefox browser the menu displays like i want to, all tied up together
in internet explorer there is a unwanted 2-3 px space between each image
what am i doing wrong? or is there a hack for this?
|

March 10th, 2005, 09:03 AM
|
|
Authorized User
|
|
Join Date: Mar 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
switched back to table for the menu
due to time restriction
but i'm happy to find out a method how to get this to work
in internet explorer without tables
|

March 10th, 2005, 10:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
|
|
As far as I know the only way to get around that whitespace bug in IE is to put all the markup on one non-breaking line. That is, remove all the line breaks and extra space between the[list], <li>, </li> and </ul> tags. That's an easy hack to stomach if you can output it with a server side language. For instance, if I were using PHP on the server I could do something like this:
echo "[list]".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"</ul>\n";
I can still read the code in the source file, but in the browser when I view the source, it looks like this:
[list]<li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li></ul>
And there is no extra whitespace in IE.
I've also had some success with applying a display: inline; declaration to the <li> elements, but that hack can have other nasty repercussions, depending on the layout.
HTH!
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|

March 10th, 2005, 11:02 AM
|
|
Authorized User
|
|
Join Date: Mar 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by richard.york
As far as I know the only way to get around that whitespace bug in IE is to put all the markup on one non-breaking line. That is, remove all the line breaks and extra space between the[list], <li>, </li> and </ul> tags. That's an easy hack to stomach if you can output it with a server side language. For instance, if I were using PHP on the server I could do something like this:
echo "[list]".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"<li><a href='#'>link</a></li>".
"</ul>\n";
I can still read the code in the source file, but in the browser when I view the source, it looks like this:
[list]<li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li><li><a href='#'>link</a></li></ul>
|
i tried that now, but still no luck
check here:
http://84.30.32.166/eadtu_conf2005/default_wrox.htm
|

March 10th, 2005, 11:07 AM
|
|
Authorized User
|
|
Join Date: Mar 2005
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hmmm
display: inline; worked for me
but what are the nasty repercussions then? or could be?
|

March 10th, 2005, 11:29 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Well if you don't see any repercussions, then there aren't any. Because an inline box is totally different from a block box (the <li> default), sometimes applying display: inline; will really mess up the design. If it works though, go with it!
If that first hack didn't work, it could be because of the images. I just remembered having loads of trouble eliminating that white space bug when there were images present. I beleive I ended up using <div>s in a similar design to get around that.
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|

March 11th, 2005, 08:44 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I haven't looked at the update yet, but one thought:
Don't forget that IE can be sticky with files. By that I mean that even after an update to a file sometimes it won't read the update unless you force it to (by clearing the cache, or sometimes even stoping and restarting IE, or sometimes even restarting the whole computer!).
HTH!
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|

March 11th, 2005, 08:56 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,697
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Here's another IE trick that I'm fond of when others fail.
<!--[if lt IE 7]>
<style type='text/css'>
li {
margin: -1px 0;
}
</style>
<![endif]-->
This stretches the top and bottom by 1 pixel but does nothing to the left and right. It also appears in conditional comments, so only IE sees it.
I didn't see the display: inline; in the style sheet. Did that not work? I didn't look very closely either, just glanced at it.
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |