FAQ Database Discussion Community


CSS: tags disabled after using pseudo elements

css,hyperlink,anchor,absolute,pseudo-element
I'm doing a CSS exercise wherein the old BBC's site is to be cloned. The original problem was that the white bottom borders of the #topmenu li's appeared wonky (I included this code in the page below as a comment) That has been fixed by adding the right red border...

python code only works if whatever I type in is in between quotation marks [closed]

python,absolute
I was trying to follow an exercise by the book "Python for the absolute beginner" and I kept getting an infinite loop no matter what I did. I googled the answer to see if someone got it and I tried this code: http://pastebin.com/snnuvBLf only to find out that it wasn't...

Passing absolute file name to read file in c++

c++,file,absolute
// I am trying to read a file inside a function by calling the function in main and passing the file name as an argument. It's giving an error in opening the file.But same works fine when I pass the file name directly file("file_name"). Why is it so? Thanks in...

vertically centring not working in firefox

javascript,jquery,html,css,absolute
I have the following code which creates an 'img-cell'div which is empty with a height and background-image. And a 'text-cell' div underneath. (both 100% width) (php code removed, it doesn't affect the layout) HTML <article> <div class="img-cell"> </div> <div class="text-cell"> <div class="extra-css" > <h1>Title</h1> <h3>Category</h3> </div> </div> </article> CSS article...

Place an absolute element in bottom of a container with overflow: auto

html,css,position,absolute
I have a logo that should be positioned in the very bottom of a fixed container. It works OK with position: absolute; however if I add overflow-y: auto; to the fixed container and add content that doesn't fit the viewport height, my logo will stick to the bottom of the...

css position relativ differentiates from absolute

css,position,absolute,relative
I got troubles using relative positions. Following code in css: #background { background-color: gray; position: absolute; left: 100px; top: 100px; width: 500px; height: 500px; } #p1 { position: relative; left: 100px; top: 100px; width: 10px; height: 10px; background-color: green; } In my opinion, the upper-left corner from background and p1...

Final position after CSS3 animation doesn't stick when using vh units and resizing browser window

css,css3,animation,absolute
I have an image that is absolutely positioned using vh units. I want to animate this positioning use CSS. When doing so, however, the relative nature of vh units seems to be lost. To illustrate, look at the following two examples. In both of them, drag the bottom of your...

Scrolling divs, adjusting height and position automatically

jquery,position,jquery-animate,height,absolute
I need to scroll blocks of content in a div and I need equal space between each block but I can't really predict that the height of each block will be exactly the same, some might have four lines, some might have three. However the only way I got my...

Absolute positioning doesn't stick to bottom

html,css,positioning,absolute
I'm trying to create a 1-page scrolling layout: http://codepen.io/TimRos/pen/vOXVQM Every "page" is built like this: section { display: flex; min-height: 100vh; flex-direction: column; } Now I want to be able to scroll to the different sections by clicking an anchor point located at the bottom of the section. This works...

How can I get a relative div to expand to fit its absolute contents?

html,css,css3,wrapper,absolute
I'd prefer to do this using only CSS. I have a relative element which contains an absolute element. I want the relative element to be sized based on how big the absolute element is, so in other words it should wrap neatly around it. To illustrate, in this fiddle, "footer"...

CSS Absolute Position Not Positioning a Button [closed]

html,css,absolute
Good morning! I have a background image that I am trying to place some text and some buttons. I can place the text (only using padding it seems) but cannot get my button to place correctly. I've tried dozens of different workarounds but can't get anything to work. Any help...

Is using position: relative on html tag advised?

html,css,position,absolute,relative
I just found out a solution for creating sticky footers: html { position: relative; } #footer { position: absolute; bottom: 0; left: 0; right: 0; } Though I am wondering on how advised it is to put position:relative on the html tag. The way I understand it: instead of position:...

HTML & CSS - Absolute positioned div overflows relative div, unexpected result

html,css,overflow,absolute,relative
I have an absolute positioned div(contains some text) within a relative div (contains an image) and it is set to bottom: 0px; however the absolute div is overflowing below the image. I cannot seem to fix this issue, I have tried applying overflow: hidden to the relative div. Please see...

absolute positioned div images overlapping

html,css,image,css-position,absolute
I am trying to put together a social-media bar for a website and am using images as the links to each. I have an animation set for each image and for the animation to work properly, the img position needs to be set to absolute. The problem I am running...

Using position fixed with content that uses absolute and float:left

html,css,css-position,absolute
I'm using a sidebar menu that uses position fixed and slides out from left to right using JavaScript. This works ok apart from one page that is being troublesome for me. The troublesome page contains the fixed side bar and content to the right that contains absolute positon and floating...

How to absolute position an element with percentages?

css,css-position,absolute
I have an element that I'm trying to absolute position to the center and right near the bottom. Whether I do 50% from right or left, seems to be slightly off center. In this screenshot you can see that it's a little to the left from center. a.down { font-size:70px;...

iTextSharp - Table in absolute coordinates

c#,table,itextsharp,coordinates,absolute
I am trying to use this tutorial to position table in absolute coordinates using iTextSharp. Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using iTextSharp; using iTextSharp.text; using iTextSharp.text.pdf; using System.IO; namespace iTextSharpQuestion { class Program { static void Main(string[] args) { System.IO.FileStream fs = new...

Absolute positioned item in a flex container still gets considered as item in IE & Firefox

css,css-position,flexbox,absolute
If I have multiple elements with the property justify-content: space-between in a flex container and I want to absolute position one of them and remove from the flex flow, as showed here: This works in Chrome but not in IE and Firefox as the absolute positioned element is considered as...

How to center div vertically inside of absolutely positioned parent div

html,css,vertical-alignment,absolute
I am trying to get blue container in the middle of pink one, however seems vertical-align: middle; doesn't do the job in that case. <div style="display: block; position: absolute; left: 50px; top: 50px;"> <div style="text-align: left; position: absolute;height: 56px;vertical-align: middle;background-color: pink;"> <div style="background-color: lightblue;">test</div> </div> </div> Result: Expectation: Please suggest...

Max-Width Paragraph in Absolute Container

html,css,dynamic,absolute
I want a paragraph inside an absolutely positioned element to break the text at a specified max-width, but not fill the entire space if the content is smaller. <p>Text <span class="cite">Reference <span class="citeBox">A long sentence that needs to have a line break.</span> </span>. Text <span class="cite">Reference <span class="citeBox">Short</span> </span> Text....

Absolute PNG image won't link

php,click,absolute
So I am working to make a change on this site. http://www.kbduct.com . One the site there is a png file of a transparent united states logo on the front. I had to add a small awfs logo banner to it and have the viewer be able to click on...

Navigation submenu pushes body downward

html,css,absolute
I am aware to use the absoulte position to the submenu tag; however when I do it solves the problem but only the last entry of the submenu displays. The others seem to have been swallowed up. Please help! My code is shown below: * { margin: 0; padding: 0;...

Text is breaking using absolute positioning

html,css,absolute
I have a small challenge that I haven't found any solution on Stack Overflow. That's what I got: And that's how I'd like it: To produce this title effect I'm using absolute position. I don't even know the width and the height from my title. So, big text breaks when...

centre iframe absolute position in html page

html,iframe,positioning,absolute,clipping
I have an iframe which I have clipped at the top, but want to centre on the webpage and zoom on load. I can clip it, but cannot position it, even with a relative div container, so as to maintain the clipped area at the top. JSFiddle <div id="content"> <div...

How can I use local absolute path as a src attribute for an image

javascript,html,path,local,absolute
I'm trying to make the source of my image like this <img id="testImage" src="C:\images\1.jpg"> but this doesn't work, i also tried changing all the \ with / but it gave me the same not working result the reason for this is that i want to make a web page that...

dirname(__FILE__) adds path after my domain

php,apache,path,absolute,dirname
Here's my problem using the PHP function dirname() Let me first explain, I'm working on a website where I defined a constant as follow : define('ROOT', dirname(__FILE__)); That worked well on a shared hosting, but I had to move the website on a dedicated server and now some files I...

Position absolute but with fixed scrolling

html,css,scroll,fixed,absolute
I would like it so the buttons stay on the screen. Right now i use position absolute, so the buttons are a fixed amount to the left and right of the list. But i also want it so the buttons stay in place while scrolling (like with position: fixed). http://jsfiddle.net/6vb5u7eg/1/...

CSS: Absolute Element inside Absolute Element [duplicate]

html,css,absolute,relative
This question already has an answer here: Absolute positioning inside absolute position 4 answers I'm studying CSS and as I learn, when an absolute element A inside relative element B, that A will be relative to B. I want to test the case absolute element inside absolute element but...

absolute positioned within a relatively positioned
  • works in chrome & IE11, NOT firefox
  • image,browser,compatibility,absolute,relative
    I am making a roster. I have a container absolutely positioned. Within this, I have an unordered list with several list items positioned relatively. Within each list item I have some text (displaying their name) and then below this an absolutely positioned image (of them). It works great in both...

    Combine float and absolute position

    javascript,html,css,css-float,absolute
    I am creating a calendar where all the events are displayed in a single div. According to the top and height values, the event should be placed in a determinate place. Let me show you. In this image, both events at 6am are at the same vertical alignment. I can...