Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a Dom element visible but don't take up space on the page?

Tags:

css

What CSS will produce an element but the browser won't take it into account for laying out anything else? Is such a thing possible?

I want the bird and dog on this page to not affect the centering of the text. http://twitter-meme.appspot.com/

Some solutions that I don't like:

  • Make a single image and set it as background-image. (Then I end up with a big image as a background).
  • Absolutely position the text (Yuck)
like image 200
Paul Tarjan Avatar asked Nov 09 '09 10:11

Paul Tarjan


2 Answers

You could use position:absolute on the two images by setting the parent div to position:relative and then positioning the images to left:0 and right:0 respectively.

like image 94
Gabriel Hurley Avatar answered Oct 29 '22 01:10

Gabriel Hurley


Make the container have position: relative; and then absolutely position the images respective to the container.

like image 26
reko_t Avatar answered Oct 29 '22 02:10

reko_t