Announcement Announcement Module
Collapse
No announcement yet.
Linking to a certain section of another page...bug? Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • CataclysmX
    Reply to Need advice for logo
    CataclysmX
    What does the organization do? So far its pretty simply and I like it, it seems a bit jagged but maybe that's how it uploaded. I kind of see a D k, and a t just because of how the k connects to the D,...
    Today, 05:43 PM
  • Diggidy
    Graphic Designer for mobile video game
    Diggidy
    We are in need of a Graphic Designer for mobile video game. The game is a 2D platformer style game.
    Please send your resume/website/past work in order to be considered. In return you will be sent...
    Today, 04:30 PM
  • <b>
    Reply to Crisp web graphics, how?
    <b>
    That will produce worse results. For example, if you specify the size in which the image displays as 200 x 200 pixels, but you upload a 300 x 300-pixel image, your browser will still need to display that...
    Today, 03:53 PM
  • kemingMatters
    Reply to Crisp web graphics, how?
    kemingMatters
    Sorry I'm not familiar with square space, so .svg might not be the answer. Is your MBP at retina model?
    Are you exporting as png from illustrator? have you tried saving for web via photoshop?...
    Today, 03:32 PM
  • Cosmo
    Comment on High School Football Program
    Cosmo
    Yeah. I can't tell you how many ads I got that was literally four or five photographs cut up with scissors taped to a piece of notebook paper with barely legible handwriting on it. I was always so tempted...
    Today, 03:32 PM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linking to a certain section of another page...bug?

    I know how this is accomplished...

    <a href="http://blah.com/page2.html#section2"><a>

    on page2.html...

    <h2 id="section2"></h2>

    It works fine when I put the id on a header element, but if I try to put it on a div it doesn't work. Is this normal? I noticed it works in IE7, but not Firefox or Safari.

  • #2
    You should be targeting a named anchor, not an id:

    <a href="http://blah.com/page2.html#section2"><a>

    on page2.html...

    <a name="section2"><a><h2 id="section2"></h2>


    Digi
    The world is divided into people who think they are right.
    —Anonymous

    Comment


    • #3
      Originally posted by digizan View Post
      You should be targeting a named anchor, not an id:

      <a href="http://blah.com/page2.html#section2"><a>

      on page2.html...

      <a name="section2"><a><h2 id="section2"></h2>


      Digi

      seems a little weird to put a blank anchor tag doesn't it?

      Comment


      • #4
        Originally posted by MikeTheVike View Post
        seems a little weird to put a blank anchor tag doesn't it?
        Not to me it doesn't. ;-)

        You could wrap your anchor around the text of your heading:

        <h2 id="section2"><a name="section2">Foo<a></h2>

        But then you're probably going to have to add more CSS to stop the heading from looking like a link.

        Digi
        The world is divided into people who think they are right.
        —Anonymous

        Comment


        • #5
          Okay, I've been up all night finishing a web site and my brain is toast right now.

          This should work:

          <h2 id="section2" name="section2">Foo</h2>

          Digi
          The world is divided into people who think they are right.
          —Anonymous

          Comment


          • #6
            Originally posted by digizan View Post
            Okay, I've been up all night finishing a web site and my brain is toast right now.

            This should work:

            <h2 id="section2" name="section2">Foo</h2>

            Digi

            yea, it actually works with just the "id", the "name" isn't necessary. I was just wondering why it wasn't working on a div because it would make my heading a little more visible if the page jumped to the top of my div instead of the heading.

            Comment


            • #7
              Originally posted by MikeTheVike View Post
              yea, it actually works with just the "id", the "name" isn't necessary. I was just wondering why it wasn't working on a div because it would make my heading a little more visible if the page jumped to the top of my div instead of the heading.
              Yeah, now that I've gotten a couple of hours of sleep it's clear what you were asking. I should know better than to post on the forums when I'm dead tired like that.

              Anyway, I created a test page and have no problem jumping to a div using an id in either FF or Safari. Maybe you're overlooking something?

              Digi
              The world is divided into people who think they are right.
              —Anonymous

              Comment

               
              home | site map | advertising/sponsorships | about us | careers | contact us | help courses | browse jobs | freelancers | events | forums | content | member benefits | reprints & permissions about | terms of use | privacy policy | Copyright © 2014 Mediabistro Inc. Mediabistro Inc. call (212) 389-2000 or email us
              Working...
              X