Solved

How to resize hyperlink control locations on a web page using Java Script and CSS ?

Posted on 2013-05-12
3
247 Views
Last Modified: 2013-05-19
I have some web pages with hyperlinks at the top of the web pages in my website, which serve as the website navigation. On each page in my Java Script, I customize the location of the hyperlinks using Java script and CSS. Example :

    document.getElementById('CredentialsLink').style.marginLeft = "885px";
 
    document.getElementById('CredentialsLink').style.marginRight = "67px";
 
    document.getElementById('RenterLink').style.marginRight = "75px";

The problem is that the links will align differently if the browser is even slightly resized (Ctrl ++, or CTRL -- are examples)

Also the locations will be slightly different in different web browsers. How can I make it so that my links are located in a standard location on the page, even if the page is resized?
0
Comment
Question by:brgdotnet
3 Comments
 
LVL 21

Expert Comment

by:Kim Walker
ID: 39162033
Can you provide a link to a live page so we can see what's happening?
0
 
LVL 2

Author Comment

by:brgdotnet
ID: 39163569
Hello, unfortunately, No,

You see, this is an intranet application I am creating for a company, and it will not be visible to the world.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 220 total points
ID: 39165391
You can probably try using position:absolute and setting the top and left values, but it is likely that will break something else.  Without seeing the page it is virtually impossible to give advice on a positioning problem.

Cd&
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now