I would think this would be a common issue, but my search for a solution leads me to believe it may not be possible. I simply want to place a div in the lower right corner of its parent div, yet have the text in the parent div flow around it.   Although I've found many posts addressing this question, I have not found one that appears to work. Most of these posts were several years old, which gives me a sliver of hope that there may be a way to do it after all with HTML 5?  I should have mentioned that this is in pursuit of a responsive design, so a static solution will not work.   Here's what I'm attempting to do:   I have a background image in the lower right of the div. I would like the text within this div to not flow across the image, but around it instead.  I thought I'd be able to place an empty div (represented by the purple rectangle in the referenced page) in the lower corner to prevent text from flowing across the background image, but I can't seem to find a way to accomplish this.
48709
Every time I try to do something seemingly-simple in CSS, it doesn't work.  I have a content div that contains a 460x160 image. All I want to do is position the image at the bottom-right corner and wrap my text around it.  &lt;div id="contents"&gt;     &lt;img src="..." /&gt;     text text text text text text ... &lt;/div&gt;   So I want it to look like:  ------------------ | text text text | | text text text | | text text -----| | text text |    | ------------------   Doing it with a top-left or top-right image is cake:  #contents img { float:right; }  ------------------ | text text |    | | text text -----| | text text text | | text text text | ------------------   Now how do I push that to the bottom? The best I've come up with so far are:  #contents img { float:right; margin-top: 90%} // really needs to be 100%-160px  ------------------ | text text      | | text text      | | text text -----| | text text |    | ------------------   In this case the text does not print in the margin, so there is white space above the image.  #contents { position:relative; } #contents img { position:absolute; right:0; bottom:0; }  -or-  // move the img tag under the text in the html and: #contents img { float:right; margin-top:-160; }  ------------------ | text text text | | text text text | | text text -----| | text text | te | ------------------   In this case the text prints over or under the image.  So... how can I accomplish this?
58040
I want to add background image, to part of my header i wrote code like this.  but its not working.   &lt;div style="{!'background:' + v.backgroundColor + ' url(' + v.backgroundImageURL +') no-repeat;background-position: center;background-size: cover;'}"&gt;  &lt;/div&gt;     doInit : function(component, event, helper) {          var url = $A.get('$Resource.RollingHillsGrey1');         component.set('v.backgroundImageURL', url);     }
10537
I'm using Prototype's PeriodicalUpdater to update a div with the results of an ajax call.  As I understand it, the div is updated by setting its innerHTML.  The div is wrapped in a &lt;pre&gt; tag.  In Firefox, the &lt;pre&gt; formatting works as expected, but in IE, the text all ends up on one line.  Here's some sample code found  which illustrates the problem.  In Firefox, abc is on different line than def; in IE it's on the same line.      &lt;html&gt;     &lt;head&gt;       &lt;title&gt;IE preformatted text sucks&lt;/title&gt;     &lt;/head&gt;     &lt;body&gt;       &lt;pre id="test"&gt;         a b c         d e f       &lt;/pre&gt;       &lt;script type="text/javascript"&gt;&lt;!--       var textContent = document.getElementById("test").innerText;       textContent = textContent.replace("a", "&lt;span style=\"color:red;\"&gt;a&lt;/span&gt;");       document.getElementById("test").style.whiteSpace = "pre";       document.getElementById("test").innerHTML = textContent;       --&gt;&lt;/script&gt;     &lt;/body&gt;     &lt;/html&gt;   Anyone know of a way to get around this problem?
30717
When I can scroll down far enough to have the hot network questions overlap the footer (because my question is short) there is no background under the text:    Could they either be given a white background: (just disable the transparency option)    Or stop at the footer:      This also happens with the help text on some sites, as per this bug report:     Ubuntu 14.04.1 (Latest LTS Version), . Same problem with  and .  Windows 10 Pro,  and .  (Images linked to screenshot of browser)  My question is different from  because my issue is the lack of background on the footer.   I think there was a site redesign?
914
I want to overlay one image with another using CSS. An example of this is the first image (the background if you like) will be a thumbnail link of a product, with the link opening a lightbox / popup showing a larger version of the image.   On top of this linked image I would like an image of a magnifying glass, to show people that the image can be clicked to enlarge it (apparently this isn't obvious without the magnifying glass).
69815
Consider the following:  Let's say I have a dot. I would like to be able to position this dot anywhere on the page: at the corner, in the middle, anywhere.  So far, despite poring over manuals and experimenting, I can not figure out how to do this. It seems logical that there would be some system that would place a conceptual grid on the page and then allow for an exact placement within that grid.  I'm sure it exists, but I can't seem to find it.  I can make the dot, and all sorts of other shapes, but I just don't seem to have any control over where these shapes appear on the page.  I'm sure this is an obvious question and I have overlooked something.
67076
I'd like to create something similar to what is give below: text on either side of a vertically centred image:
8041
How do I go about setting a &lt;div&gt; in the center of the screen using jQuery?
8720
I'm trying to wrap some text around a raspberry shaped image that is placed to the right on the page. I would realy liked the text to follow the shape of the Raspberry. Is this possible?  Below is a MWE, and an image of what I have for now.  \documentclass[12pt]{scrartcl} \usepackage{graphicx,wrapfig,lipsum} \usepackage[onehalfspacing]{setspace}  \begin{document} \begin{wrapfigure}{r}{.3\linewidth}     \centering     \includegraphics[width=\linewidth]{raspberry_pi_logo}     \caption{Raspberry Pi} \end{wrapfigure} \lipsum[2]\lipsum[1]  \end{document}
61850
I'm trying to horizontally center a &lt;div&gt; block element on a page and have it set to a minimum width. What is the simplest way to do this? I want the &lt;div&gt; element to be inline with rest of my page. I'll try to draw an example:  page text page text page text page text page text page text page text page text                -------                | div |                ------- page text page text page text page text page text page text page text page text
63162
Let's say:  &lt;div&gt;   pre text   &lt;div class="remove-just-this"&gt;     &lt;p&gt;child foo&lt;/p&gt;     &lt;p&gt;child bar&lt;/p&gt;     nested text   &lt;/div&gt;   post text &lt;/div&gt;   to this:  &lt;div&gt;   pre text   &lt;p&gt;child foo&lt;/p&gt;   &lt;p&gt;child bar&lt;/p&gt;   nested text   post text &lt;/div&gt;   I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea how to do this.
86200
I'm trying to get images in my document in two different ways:   On top of the entire page, centered On top of a single column   I tried it with both twocols and multicols. I ruled out twocols because it forces a new page every time you turn it on, because I need the abstract to be wide and the rest of the cover page to be two columns.  Here are some examples of both points (screenshot from a downloaded PDF):   I want to achieve both, but somehow I can only solve the first point with:  \end{multicols}  \begin{figure}   \centering     \includegraphics[width=0.5\textwidth]{figure}   \caption{Dataflow pipeline of the edge detector}   \label{fig:workflowedge} \end{figure}  \begin{multicols}{2}   Is it awkward to turn off multicols, then turn it back on again?  For my second point, I've tried everything, but almost always, the image doesn't show up at all! The only way I can get it to show at all is by specifying the H placement specifier, but that places the image inside the text where I defined it, not on top of the column.  This is my best try, but it hides the image and breaks all references to ??:  \begin{figure}[t!]   \centering     \includegraphics[width=0.25\textwidth]{figure}   \caption{Dataflow pipeline of the edge detector}   \label{fig:workflowedge} \end{figure}   and I'm getting the warning:  Package multicol Warning: Floats and marginpars not allowed inside `multicols' environment!.   How can I make a figure a non-float?  I also tried the figure* environment, but that just creates an image centered on top of the page, like my first point.
112644
How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a div while the text remains opaque?  I need to do it without using any library such as jQuery, etc. (But if you know of a library that does it I'd love to know so I can look at their code).
100723
I am building an application where I want to be able to click a rectangle represented by a DIV, and then use the keyboard to move that DIV by listing for keyboard events.  Rather than using an event listener for those keyboard events at the document level, can I listen for keyboard events at the DIV level, perhaps by giving it keyboard focus?  Here's a simplified sample to illustrate the problem:  &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt;  &lt;div id="outer" style="background-color:#eeeeee;padding:10px"&gt; outer     &lt;div id="inner" style="background-color:#bbbbbb;width:50%;margin:10px;padding:10px;"&gt;    want to be able to focus this element and pick up keypresses    &lt;/div&gt; &lt;/div&gt;  &lt;script language="Javascript"&gt;  function onClick() {     document.getElementById('inner').innerHTML="clicked";     document.getElementById('inner').focus();  }  //this handler is never called function onKeypressDiv() {     document.getElementById('inner').innerHTML="keypress on div"; }  function onKeypressDoc() {     document.getElementById('inner').innerHTML="keypress on doc"; }  //install event handlers document.getElementById('inner').addEventListener("click", onClick, false); document.getElementById('inner').addEventListener("keypress", onKeypressDiv, false); document.addEventListener("keypress", onKeypressDoc, false);  &lt;/script&gt;  &lt;/body&gt; &lt;/html&gt;   On clicking the inner DIV I try to give it focus, but subsequent keyboard events are always picked up at the document level, not my DIV level event listener.  Do I simply need to implement an application-specific notion of keyboard focus?  I should add I only need this to work in Firefox.
86972
I have a number of DIV's that break up a page into logical elements for styles and positioning, etc.  As part of optimizing my site for search engine spiders, should I include a title attribute within these DIV's?  (Yes I have a title as part of the whole page, I'm curious on individual structual elements)  Ex  ... &lt;div id="SearchOptions" title="Search filters and options - Type in a name or pick a business and Click 'Search' to get started" &gt;   .... &lt;/div&gt; ...
25947
I have the following code for my masterpage:  &lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server" style="position:relative"&gt;     &lt;title&gt;Masterpage&lt;/title&gt;     &lt;asp:ContentPlaceHolder id="head" runat="server"&gt;     &lt;/asp:ContentPlaceHolder&gt; &lt;/head&gt; &lt;body&gt;     &lt;form id="main" runat="server" style="position:relative"&gt;     &lt;div&gt;         &lt;asp:ContentPlaceHolder id="MainContent" runat="server"&gt;         &lt;/asp:ContentPlaceHolder&gt;     &lt;/div&gt;     &lt;/form&gt;     &lt;br style="clear:both" /&gt;     &lt;form id="footer" style="position:relative"&gt;     &lt;div&gt;         &lt;center style="font-size:small"&gt;Footer content&lt;/center&gt;     &lt;/div&gt;         &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;   My problem is that when the MainContent isn't filling up the page the footer is not at the bottom of the page. Is there a way to force the footer to stay on the bottom of the page if the main content isn't pushing it all the way down? When the main content is "big" enough it pushes the footer down with the content and displays on the bottom when scrolling down, but not if it is to small.  Anybody know how to fix this?
13314
I'm looking for a way to insert a &lt;style&gt; tag into an HTML page with JavaScript.  The best way I found so far:  var divNode = document.createElement("div"); divNode.innerHTML = "&lt;br&gt;&lt;style&gt;h1 { background: red; }&lt;/style&gt;"; document.body.appendChild(divNode);   This works in Firefox, Opera and Internet Explorer but not in Google Chrome. Also it's a bit ugly with the &lt;br&gt; in front for IE.  Does anyone know of a way to create a &lt;style&gt; tag that   Is nicer Works with Chrome?   Or maybe   This is a non-standard thing I should avoid Three working browsers are great and who uses Chrome anyway?