473,408 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Shifting an internal anchor in viewport

Greetings,

This is my first foray into CSS and indeed my first website in general.
My goal is to use a liquid(ish) design, no javascript and no tables for
layout positioning. Rather foolishly I embarked on a "frame emulation"
type of layout for no real reason other than to see if it could be
done. Predictably I have come across many obstacles along the way, and
predictably most of them are found in IE.

(I have emulated position: fixed; in IE as outlined in;
http://tagsoup.com/-dev/null-/css/fixed/ )

I have a fixed DIV across the top of every page that has caused some
problems with internal anchors as they will focus at the top of the
viewport underneath the fixed DIV. I came up with an ugly solution that
requires a little extra markup HTML, but I can live with that.

HTML:
<ol>
<li><a href="#h2.intro">Introduction</a></li>
<li><a href="#h2.whats_new">What's New?</a></li>
</ol>

[~]

<div id="h2.intro" class="anchor"><div>
<h2>Introduction</h2></div></div>

CSS:
div.anchor {
position: relative;
top: -9em;
}

div.anchor div {
position: relative;
top: 9em;
}

URL:
http://www.boozers.net.au/

The fixed DIV at the top of the page is 9em high. This works in Firefox
1.5 and Opera 8.5, however it doesn't play nice in IE6.

Does anybody know an alternate method that will work in IE6?
(2)
I also have another quick query regarding forcing the width of a
floated DIV. Basically I have;

HTML:
<div id="content_wrapper">
<div id="content">
Some Content
</div>
<div id="navtop">
Some Content
</div>
<div id="footer">
Some Content
</div>
</div>

CSS:
#content_wrapper {
float: left;
width: 100%;
}

#content {
float: left;
margin: 0 10em 0 0;
}

#navtop {
float: left;
margin: 0 0 6em -10em;
width: 10em;
}

#footer {
clear: both;
width: 100%;
}

example URL:
http://www.boozers.net.au/library/

Is there any way to force the content DIV to use all the available
width?
Sorry for the long post. I would also appreciate any and all
suggestions regarding the site (excluding content which is non-
existent).

TIA

--
Rob McKenna,
Rain God.
Feb 10 '06 #1
2 2996
Rob McKenna <23*@rain.god> wrote:

[Shifting an internal anchor in viewport]
The fixed DIV at the top of the page is 9em high. This works in Firefox
1.5 and Opera 8.5, however it doesn't play nice in IE6.

Does anybody know an alternate method that will work in IE6?


I dislike position:fixed and particularly the methods to emulate it in
IE, but maybe this method can be used for the IE emulation also:

http://www.spartanicus.utvinternet.ie/link_offsets.htm

--
Spartanicus
Feb 10 '06 #2
Spartanicus wrote:
Rob McKenna <23*@rain.god> wrote:

[Shifting an internal anchor in viewport]
The fixed DIV at the top of the page is 9em high. This works in
Firefox 1.5 and Opera 8.5, however it doesn't play nice in IE6.

Does anybody know an alternate method that will work in IE6?


I dislike position:fixed and particularly the methods to emulate it
in IE, but maybe this method can be used for the IE emulation also:

http://www.spartanicus.utvinternet.ie/link_offsets.htm


Thanks for the reply Spartanicus. I had read that method on your site
before, however when I apply it to a heading that has a size greater than
100% it applies too large a padding. Additionally IE seems to ignore an
empty <a> tag.

<h2><a id="h2.intro" class="anchor"></a>Introduction</h2>

a.anchor {
padding-top: 9em;
}

http://www.boozers.net.au/

--
Rob McKenna,
Rain God.
Feb 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Stockwell | last post by:
Hi, My background is c/c++ and java. I'm learning python at this point. My question is does python share java's peculiar mode of bit shifting, or does python adhere closer to c's bit shifting?...
6
by: PhillyFan | last post by:
I have a page setup using anchors. For some reason not all the anchors are working correctly. The last three anchors do not start where they are supposed to. I then started removing the anchor...
5
by: metalseb | last post by:
Hi folks I want to implement a full CSS navbar on the top of my page. Basically, this is a DIV with links on <li> tags shown in inline display. Things are going right, but if I want to show a...
5
by: Ric Castagna | last post by:
Greetings, all... I've got a (for me) stumper... I need to attach what will amount to a float:right; sidebar to a specific location on a page. Not an absolute position, mind you, but to a...
4
by: Iain Adams | last post by:
Hello, I have a page with a text field. When something is typed into the text field and a button is clicked I want the page to scroll to the relevant place on the page that has the value of the...
12
by: Boltar | last post by:
I seem to be having yet more wierd issue with bit shifting. It seems the following code doesnt do anything under gcc (ie it returns -1 as both results). Anyone know why? Is it another language...
0
by: rohit1979 | last post by:
Hi, I have shifted the origin of a picturebox and changed its extents using the following statements: Call SetViewportOrgEx(PictureBox1.hDC,100, ViewExtY-100, ViewOrgOld) Call...
3
by: Joel Hedlund | last post by:
Hi! I've raised this issue on #pygtk and #gtk+ but with no luck. I haven't been able to solve this even with aid of google, the pygtk reference and the gtk C source, so pretty please help? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.