Fragment ID alignment help "XHTML" |
Fragment ID alignment help "XHTML" |
dmdum |
Feb 24 2016, 10:36 PM
Post
#1
|
Group: Members Posts: 1 Joined: 24-February 16 Member No.: 24,023 |
This is going to be really simple for some I'm sure, but I can't figure out how to align the fragment Id "photos" for my h2 to "top".
Any help would be much appreciated. I've tried align="top" td-valign="top" valign="top" text-align="top" and I'm not sure what the heck to use. I've tested each one with "bottom" to see if it changes, and it never does. CODE <!DOCTYPE html> <html> <body> <h2 id="photos" valign="top"Photos</h2> <p> This is the section that will use the fragment ID "Photos". When a link is placed using the Id Photos, it will take you to this section on the page. </p> </body> </html> |
CharlesEF |
Feb 25 2016, 12:10 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
To begin with you are missing the closing > character in the <h2> section. You should not use valign, you should use CSS instead. How does this look to you:
CODE <!DOCTYPE html> <html> <body> <h2 id="photos" style="margin: 0 0 0 0; padding: 0 0 0 0;">Photos</h2> <p> This is the section that will use the fragment ID "Photos". When a link is placed using the Id Photos, it will take you to this section on the page. </p> </body> </html> BTW, if you want to link to the <p> you should assign an 'id' to it and use that 'id' in your link. This post has been edited by CharlesEF: Feb 25 2016, 12:11 AM |
CharlesEF |
Feb 25 2016, 12:14 AM
Post
#3
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Oh, and you are missing the <head> section also. And if you want even more to the top try this:
CODE <!DOCTYPE html> <html> <head> <style> body { height: 100%; margin: 0px; padding: 0px; } </style> </head> <body> <h2 id="photos" style="margin: 0 0 0 0; padding: 0 0 0 0;">Photos</h2> <p> This is the section that will use the fragment ID "Photos". When a link is placed using the Id Photos, it will take you to this section on the page. </p> </body> </html> This post has been edited by CharlesEF: Feb 25 2016, 12:17 AM |
pandy |
Feb 25 2016, 05:50 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Just for the record, align and valign doesn't apply to headings anyway and even so 'top' isn't a value for align. And td-valign doesn't exist in the first place. Don't guess. It just makes things worse.
|
Lo-Fi Version | Time is now: 26th April 2024 - 04:12 PM |