definition list, dt and dd on same line IE7


/ Published in: PHP
Save to your folder(s)

have dt and dd inline is done automatically in Firefox, but screws up in IE7. So we need additional css rules, which have to be applied only if IE is used.


Copy this code and paste it in your HTML
  1. Create a news CSS document (iestyles.css):
  2. /*Style for IE7*/
  3. #adv-search dl{
  4. margin: 0;
  5. padding: 0;
  6. }
  7. #adv-search dt{
  8. margin: 0;
  9. padding: 0;
  10. display:inline;
  11. }
  12. #adv-search dd{
  13. margin: 0;
  14. padding: 0;
  15. display:inline;
  16. float: none;
  17. }
  18. #adv-search dt+dd{
  19. display:block;
  20. }
  21.  
  22. HTML head:
  23. <!--[if IE]>
  24. <link rel="stylesheet" type="text/css" href="../css/iestyles.css" />
  25. <![endif]-->
  26. HTML body apply adv-search id to the div containing the dl.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.