To fix this issue Here you go: http://codepen.io/n3ptun3/pen/avrXaE?editors=110 To complete this, I positioned the #navbar relative to its normal position. Then I absolutely positioned the #logo and #container (from their first positioned ancestor element, i.e. #navbar.)
this one helps. I my experience using absolute positioning works well on elements you are in 100% control of in terms of size; like a logo, a meny, rss links and things like this. Then you can place these elements exactly where you want them. I prefer using float when I am displaying dynamic content on a page, since the size of the element can change, and the placement of all elements in relation works really good with floats. Just remember to clear the floats when needed!
Positioning absolute inside list with positioning relative for jQuery animation
it should still fix some issue When you apply positioning to an element, it will use the positioning available on it's parents. If none is provided, it will position to the body element. So when you position: absolute to get the text/link at the bottom of the element, you have to position: relative (or position: absolute) one of it's parents, otherwise it won't know which you want it to position in relation to. Conversely, whichever it finds first, it will use that element to position against. I think it's possible you've got too much markup to accomplish what you're doing here (what is the .placeholder for? why not just use the li?), and the spans that wrap one of the blocks looks out of place (and should be a div if you really need a wrapper there). And I'm not sure, but you might want to change #items to a class, if you need to reuse it. It looks out of place as an id. And your id and class names are not descriptive, and your selectors are not specific enough (generally, stay away from ul and li for styling specific parts of a page, as these have a global effect).
should help you out First off, there's a bit of html fixup needed. ( an extra double quote, a badly closed element, but ... well ... perhaps, instead of restructuring your whole thing to avoid the extra white-space at the bottom, you could just add
I think the issue was by ths following , I am having trouble styling an absolute element using media queries. Right now I have a box that is positioned at the top left-hand corner of the screen. But, when the screen size is below 768px, I want this box to stick to the upper right-hand corner. Here's my code: , Try this: