Static website for local motocross track (circa Jun 2004)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

254 lines
8.6 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  2. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  4. <head>
  5. <title>Alazanto: Entry Comments</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta http-equiv="Content-Language" content="en-us" />
  8. <meta http-equiv="imagetoolbar" content="false" />
  9. <meta name="MSSmartTagsPreventParsing" content="true" />
  10. <meta name="ROBOTS" content="ALL" />
  11. </head>
  12. <body>
  13. <hr />
  14. <h2 class="date">Original Post</h2>
  15. <p>With a little help, I managed to work around a common rendering issue with linked list items and Internet Explorer 5 and 6 for windows. I decided to document my findings with a short tutorial on styling unordered lists (ul).</p>
  16. <p>Special thanks go to Michael Ryznar for his assistance.</p>
  17. <h3>The Rendering Bug</h3>
  18. <p>Without the necessary workaround, Internet Explorer 5 and 6 will add a large amount of white-space under linked list items. In most cases, this effect is undesirable.</p>
  19. <h3>Creating the Menu</h3>
  20. <p>First, let us create a basic, unordered list containing hyper linked text.</p>
  21. <pre>
  22. &lt;ul&gt;<br />&lt;ul&gt;<br /> &lt;li&gt;&lt;a href=""&gt;Item1&lt;/a&gt;&lt;/li&gt;<br /> &lt;li&gt;&lt;a href=""&gt;Item2&lt;/a&gt;&lt;/li&gt;<br />&lt;/ul&gt;<br />&lt;/ul&gt;
  23. </pre>
  24. <p>For the end product, we want to create a simple menu of two clickable blocks without any white space in between. So now, we will write a the corresponding CSS.</p>
  25. <p>The first step is to get rid of the bullets in the unordered list (ul).</p>
  26. <pre>
  27. ul {
  28. list-style: none;
  29. margin: 0;
  30. padding: 0;
  31. border: 1px solid #555;
  32. }
  33. </pre>
  34. <p>The list style property lets you customize the appearance of bullets. By declaring no values in this property, the display of bullets are eliminated. By giving margin-left a value of zero (for ie browsers) and padding-left a
  35. value of zero (for Gecko browsers), we eliminate the default indent of list
  36. items (li) in the unordered list.</p>
  37. <p>In addition, I added a dark grey border for styling.</p>
  38. <p>Next, we want to style the list items themselves.</p>
  39. <pre>
  40. li {
  41. display: inline;
  42. margin: 0;
  43. padding: 0;
  44. }
  45. </pre>
  46. <p>By setting the display property to the value of inline, we work around a rendering issue in the windows version of Internet Explorer 5 and 6. In addition, the margin and padding are set to zero so that extra whitespace is not created between items.</p>
  47. <p>Next, we want to make the links into solid boxes with the option of changing color on hover.</p>
  48. <pre>
  49. li a { /*/*/
  50. display: block;
  51. margin: 0;
  52. padding: 3px;
  53. text-decoration: none;
  54. background: #ddd;
  55. /* */}
  56. </pre>
  57. <p>For linked elements we will be changing the display property to a value of block. Hyperlinks are normally defined as an inline element, but to make the element into a solid box, we need it to occupy an entire line. This is the purpose of display: block.</p>
  58. <p>The margin is set to zero in order to eliminate whitespace between elements. I added 3 pixels of padding to give each element 3 pixels of spacing along the inside edge.</p>
  59. <p>In addition, a background color was added for styling.</p>
  60. <p>The most confusing elements in this section are the slashes and asterisks. /* This is how text is commented out in CSS. */ The particular pattern of slashes and asterisks prevents Netscape Navigator 4 from rendering this CSS. The browser has been prone to crashing when trying to render this element as a block.</p>
  61. <h3>The Workaround</h3>
  62. <p>To elaborate on the Internet Explorer workaround, we first need to set the display of the list items as inline. Then, the hyper link is set to display as a solid box through display: block. This method ensures that no extra whitespace displays in between the list items.</p>
  63. <p>I had to research this workaround for a new project I am working on. I will be working with Northland College on web accessibility. I don't want to give away too many details about this project, but I will share the code used to produce one of the menus in the redevelopment. Hopefully this will show a real-world context of this workaround.</p>
  64. <h3>XHTML required for a menu:</h3>
  65. <pre>
  66. &lt;ul&gt;<br />&lt;ul&gt;<br />&lt;div class="qlink-title"&gt;<br /><br />&lt;h3&gt;&lt;span&gt;Quick Links &raquo;&lt;/span&gt;&lt;/h3&gt;<br /><br />&lt;ul class="quicklinks"&gt;<br /><br />&lt;li&gt;&lt;a href="#"&gt;About Northland&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Financial Aid&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Contact NC&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Check Email&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Site Map&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Northland Store Online&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Transcript Request&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;Online Application&lt;/a&gt;&lt;/li&gt;<br />&lt;li&gt;&lt;a href="#"&gt;The Bridge&lt;/a&gt;&lt;/li&gt;<br /><br />&lt;/ul&gt;<br />&lt;/div&gt;<br />&lt;/ul&gt;<br />&lt;/ul&gt;
  67. </pre>
  68. <h3>CSS required for a menu:</h3>
  69. <pre>
  70. div.qlink-title ul.quicklinks {
  71. list-style: none;
  72. margin-top: 3px;
  73. margin-left: 5px;
  74. margin-bottom: 0px;
  75. margin-right: 5px;
  76. padding-top: 2px;
  77. padding-left: 0px;
  78. padding-bottom: 0px;
  79. padding-right: 0px;
  80. font-family: "Verdana";
  81. font-size: 11px;
  82. font-weight: normal;
  83. color: #444422;
  84. background-color: #fff;
  85. border: 1px solid #aaaa88;
  86. }
  87. div.linklist ul.quicklinks li {
  88. display: inline;
  89. margin: 0px;
  90. padding: 0px;
  91. }
  92. div.linklist ul.quicklinks a {
  93. /*/*/display: block;
  94. margin: 0px;
  95. padding: 2px;
  96. height: 14px;
  97. text-decoration: none;
  98. color: #444422;
  99. background-color: #f5f3ea;
  100. border-left: 2px solid #fff;
  101. border-bottom: 2px solid #fff;
  102. border-right: 2px solid #fff; /* */
  103. }
  104. div.linklist ul.quicklinks a:hover {
  105. text-decoration: none;
  106. color: #444422;
  107. background-color: #DEDACA;
  108. }
  109. </pre>
  110. </div>
  111. <!-- end body content //-->
  112. </div>
  113. <div id="right-container">
  114. <div id="right-side-title"></div>
  115. <hr/>
  116. <div id="right-side-content1">
  117. <!-- begin right side top content //-->
  118. <h2>Search This Site</h2>
  119. <form method="get" action="/cgi-bin/mt-search.cgi">
  120. <div>
  121. <label for="search">Keywords:</label>
  122. <input class="styled" id="search" name="search" value="Enter Text"></input>
  123. <input type="image" src="http://alazanto.org/themes/brooke/images/search-go.gif" class="styled3" alt="submit search"></input>
  124. </div>
  125. </form>
  126. <h2>Monthly Archives</h2>
  127. <ul>
  128. <li><a href="http://alazanto.org/weblog/2004_02.php">February 2004 (2)</a></li>
  129. <li><a href="http://alazanto.org/weblog/2004_01.php">January 2004 (2)</a></li>
  130. <li><a href="http://alazanto.org/weblog/2003_12.php">December 2003 (1)</a></li>
  131. <li><a href="http://alazanto.org/weblog/2003_11.php">November 2003 (3)</a></li>
  132. <li><a href="http://alazanto.org/weblog/2003_10.php">October 2003 (4)</a></li>
  133. <li><a href="http://alazanto.org/weblog/2003_09.php">September 2003 (2)</a></li>
  134. <li><a href="http://alazanto.org/weblog/2003_08.php">August 2003 (8)</a></li>
  135. <li><a href="http://alazanto.org/weblog/2003_07.php">July 2003 (4)</a></li>
  136. <li><a href="http://alazanto.org/weblog/2003_06.php">June 2003 (3)</a></li>
  137. </ul>
  138. <h2>Categories</h2>
  139. <ul>
  140. <li><a href="http://alazanto.org/archives.php">Category Listing</a></li>
  141. <li><a href="http://alazanto.org/weblog/cat_creative_nonfiction.php">Creative Nonfiction (3)</a></li>
  142. <li><a href="http://alazanto.org/weblog/cat_design_philosophy.php">Design Philosophy (2)</a></li>
  143. <li><a href="http://alazanto.org/weblog/cat_mt_carbon.php">MT Carbon (4)</a></li>
  144. <li><a href="http://alazanto.org/weblog/cat_mental_health.php">Mental Health (2)</a></li>
  145. <li><a href="http://alazanto.org/weblog/cat_notable_links.php">Notable Links (2)</a></li>
  146. <li><a href="http://alazanto.org/weblog/cat_society.php">Society (4)</a></li>
  147. <li><a href="http://alazanto.org/weblog/cat_web_design.php">Web Design (12)</a></li>
  148. </ul>
  149. </div>
  150. <!-- end right side top content //-->
  151. <div id="right-side-divider"></div>
  152. <hr/>
  153. <div id="right-side-content2">
  154. <!-- begin right side bottom content //-->
  155. <h1><span>More Info</span></h1>
  156. <p>When writing new comments, please keep in mind that I no longer support embedded HTML or textile formatting. As always, please be curtious or I might confuse your words with spam.</p>
  157. <hr class="decorated-end"/>
  158. </div>
  159. <!-- end right side bottom content //-->
  160. </div>
  161. <div id="right-margin">
  162. <div id="right-side-margin"></div>
  163. </div>
  164. <div id="copyright">
  165. <p>Copyleft 2004 Kevin Davis. All material is free to use - especially, when considering the limitation of text on a screen.</p>
  166. </div>
  167. <div id="bottom-tile"></div>
  168. </div>
  169. </div>
  170. </div>
  171. </body>
  172. </html>