SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem breaking a line of code...

    Heh all,

    I'm trying to make my code prettier by breaking the code in the editor in between a series of html buttons that have some javascript attached. When I break the line in the code editor the browser puts a space inbetween the buttons (images). Is there a way to break the code to organize it better without having this space appear in the browser?

    Example of code without line breaks in the code:

    <a href="kayak_programs.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('programs','','images/buttons/programs_o.gif',1)"><img src="images/buttons/programs.gif" alt="Kayak Instruction Programs" name="programs" width="99" height="30" border="0" onMouseOver="MM_showMenu(window.mm_menu_1217103833_0,0,30,null,'programs')" onMouseOut="MM_startTimeout();"></a><a href="about.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','images/buttons/about_o.gif',1)"><img src="images/buttons/about.gif" alt="About Us. Kayaking is our way of life!" name="about" width="88" height="30" border="0"></a>

    Example of what I want to do to make it look prettier and be more organized
    (I put in an extra space for emphasis--I just want it returned to a new line)

    <a href="kayak_programs.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('programs','','images/buttons/programs_o.gif',1)">

    <img src="images/buttons/programs.gif" alt="Kayak Instruction Programs" name="programs" width="99" height="30" border="0" onMouseOver="MM_showMenu(window.mm_menu_1217103833_0,0,30,null,'programs')" onMouseOut="MM_startTimeout();"></a>

    <a href="about.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','images/buttons/about_o.gif',1)">

    <img src="images/buttons/about.gif" alt="About Us. Kayaking is our way of life!" name="about" width="88" height="30" border="0"></a>

    This must be possible, but I'm just starting to get into hand coding (I've been dreamweavering for some time...). Anyone know the answer here?

    Thanks, eh.
    John P.

  2. #2
    SitePoint Member
    Join Date
    Dec 2003
    Location
    Leeds, UK
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE has a little bug if you space stuff out nicely. One way around it is to break up your tags a little differently to normal:
    Code:
    <a href="#">
          <img src="" />
    </a>
    could be written instead as
    Code:
    <a href="#"
         ><img src="" /
    ></a>
    I use this a lot on inline lists, as IE likes adding space where I dont want any.

  3. #3
    SitePoint Zealot jplatenius's Avatar
    Join Date
    Nov 2003
    Location
    Vancouver Island, Canada
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes! Thanks so much for the solution. If you can believe it, I wasted at least an hour trying to figure that out.

    Cheers!
    -jp


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •