How to fix the my Anchor link issue [duplicate]


Tags: html,css

Problem :

This question already has an answer here:

EDIT: From my previous post, none of the answers can satisfy my needs so I created a jsfiddle here to be more clear.

I am having an issue about my anchor tag.

I have created a jsfiddle

http://jsfiddle.net/7tMy5/

When I click my links, it will jump to the contents div. However, it seems like the content div is covered by the header div which has position:fixed specified. I want the contents jump to below my header div. How do I fix this?

I can't really change the my header div css property here...

Thanks for the help



Solution :

You mean something like this http://jsfiddle.net/7tMy5/8/ I got this code from http://www.pixelflips.com/blog/anchor-links-with-a-fixed-header/ check it out and see if this is what you wanted to achieve

<span class="anchor" id="section1"></span>
<div class="section"></div>

<span class="anchor" id="section2"></span>
<div class="section"></div>

<span class="anchor" id="section3"></span>
<div class="section"></div>

This is pretty much the new html markup for the page


    CSS Howto..

    How can i make these tabs Responsive

    How To Use CSS To Add Multiple Fonts In One Paragraph And How To Add Multiple CSS Properties To One CSS Id?

    How to order a css file?

    How to remove the bottom border of a box with CSS

    How to make a space between tags (icons) in table?

    CSS Div with background image - how to allow for expansion of div on page?

    How to target CSS module classes after they are hashed?

    CSS: How to increase distance between two elements?

    I want to add same function for two css class. How can I do it?

    How to create CSS3 bounce effect

    How to make element slide down from display:none?

    HTML5 / CSS| How do I disable responsivity when a scroll bar appears?

    How can I line up the two containers in view?

    How to set the specific prefix for file-loader in webpack?

    How to select every 4th div inside another div CSS Selector [closed]

    Slideshow with specific Text on each Image

    How to position an icon in a metro-like web GUI? (images included)

    How to silently hide “Image not found” icon when src source image is not found

    How to fix this common problem of position:fixed elements not expanding to its parent width?

    How to create a circle and a bar that overlap with css?

    how to get text beside image button using CSS

    How to override HTML image using CSS

    How to apply css styles to a tag?

    How to use Grunt while continually compressing css / javascript

    How to make this grey kind of background with css?

    How to calculate effective CSS for a DOM node using PHP

    How to align two columns of text in CSS

    How to set froala to calc height using css

    How to set a minimum content size of a webpage in html, css? [closed]

    White space in between banner image and menu bar on site-only 1080px screen and lower. How to fix? [closed]