473,583 Members | 3,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change location of anchor target by a few pixels

DogBot
11 New Member
I need all of my anchors to go about 30 pixels above where the anchor tags are placed (there is a floating piece of interface at the top of the page) Is this possible?

Thank you
Dec 9 '09 #1
24 28056
Dormilich
8,658 Recognized Expert Moderator Expert
Is this possible?
yes. : )
Dec 9 '09 #2
Frinavale
9,735 Recognized Expert Moderator Expert
Yes it is possible.
Please take a look into how CSS styles can help you to achieve this.
One possible way to achieve this is to use the display property combined with the position property.

This has nothing to do with JavaScript so I have moved this question to the HTML/CSS forum.
Dec 9 '09 #3
DogBot
11 New Member
hmmm...Perhaps I did not phrase my question correctly.
When I click on a link with an anchor the browser puts the line where the anchor is at the top of the browser window.
I instead want it to put that line about 30 pixels down from the top of the browser window.

Now I can see how I MIGHT be able to make a style for the anchor where it is always 30px above where it is places (margin relative -30px?) or something like that. is that what you mean?
Where does display come into that? i know very little CSS, I am just learning. Thanks

Dormilich, I did not state it so, but my question implies "how" not just "if". Still At least I know It can be done and I am not wasting my time.

Is this website not for newbie questions? Perhaps I should ask elsewhere? let me know . thanks
Dec 9 '09 #4
Frinavale
9,735 Recognized Expert Moderator Expert
DogBot, Dormilich was just playing around.
It doesn't matter what skills you have, your questions are always welcome here.

It might help me if you had a link or something to the page that you're working with so that we can see what you're talking about...I'm not sure what you're talking about.

To me, at least, an anchor is an <a> tag, which is a link (also known as a HyperLink)

So when you say:
When I click on a link with an anchor
I don't have a clue what you're talking about.
It's even more confusing when you say:
The browser puts the line where the anchor is at the top of the browser window

A picture (or a link in this case) is worth a thousand words!

-Frinny
Dec 9 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
A picture (or a link in this case) is worth a thousand words!
yes. : )

edit: sorry, but I couldn’t resist.
Dec 9 '09 #6
Frinavale
9,735 Recognized Expert Moderator Expert
Hehe.
Dorm, are you just trying to increase your post count?
;)
Dec 9 '09 #7
drhowarddrfine
7,435 Recognized Expert Expert
I couldn't have written this better myself:
How to get a quicker, more complete answer.
Dec 9 '09 #8
DogBot
11 New Member
here it is

The problem is with "in page links". they end up under the header.

Good point on how to ask a question. I will try to be more thorough
Dec 9 '09 #9
Dormilich
8,658 Recognized Expert Moderator Expert
The problem is with "in page links". they end up under the header.
just had a look with Firefox. I can’t spot anything obviously out of place. which links do you mean?

though I’ve spotted another problem. the apostrophes (’ like in Gouvernment’s) are not displayed correctly. there’s some kind of charset problem.

edit: didn’t see anything under the header either.
Dec 9 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
16848
by: ras | last post by:
Hi, I've the following piece of code use window.location to open a new window an pas them some paramenter. I'd like to open the new windows in a frame using a javascript. how can I do that. Pls. help. <input class="nxtbutton" type="button" id="NXT_FormLink" value="<?php echo $KT_language;?>"
2
8368
by: duikboot | last post by:
Hi there, In Photoshop I can, when I want to change the dpi(dots per inch) of a picture, arrange that the picture won't be resized. Do you know of a way, I can accomplish this in python with PIL? If I use this script it changes the dpi, but the picture becomes huge. Thanks Arjen
1
3462
by: Bryan | last post by:
Hi, I have a form that I want to click a button on and cause the location.href to change. this is what I used: the function: function testform(){ location.href="http://www.google.com" }
2
2594
by: Ken Baltrinic | last post by:
Don't ask my why we need to do this, I didn't write the website policy :( , but we are deploying to a website where we cannot place any directories directly off web root (i.e. aspnet_client) and therefore we need to tell all those lovely validation controls that their js files have moved. Is there a setting somewhere that we can change to...
1
1323
by: klynn | last post by:
I just built a .NET app where I put in the page an anchor such as: <a id="whatever" href="somesite" target="_blank">My anchor</a> for just one of my clients, when they click this anchor, ALL of their open windows associated with my .NET app close. Any idea why? I can't duplicate this on any other machine.
1
1348
by: Pim Sohful | last post by:
Hi, I have a website full of external links. On the site I have a checkbox where users can indicate that they want to have the link opened in a new window or in the same window. It is rather basic code: var anchors = document.getElementsByTagName("a"); for (var i = 0; i < anchors.length; i++)
2
3176
by: monomaniac21 | last post by:
Hi all is it possible to get a button in an iframe to change location of parent page? regards marc
1
4203
by: libsfan01 | last post by:
Hi all is it possible to get a button in an iframe to change location of parent page? regards marc
0
5446
by: oopaevah | last post by:
Hi, I have a set of valid xhtml pages that a third party web site is integrating with via an <iframein his own page. This retains his own branding template in the header and footer, with the iframe containing my pages in the middle of the screen. When it is time to exit my pages, to take the user back to the third party web site, I need...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7929
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8190
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1152
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.