Showing image overflow from one div to another div - asp.net

Please refer the following links for image and diagram. Image, diagram This is the sample image. Here "Messages" title is a separate div float at left "Joe Smith and you" div is float at right. In left side all the messages are in separate divs. Now i need to change the background image on hover as shown below (like a blue arrow). The background image need to overflow from left div to right div. I tried this following code but it wont works. It get cut appropriate to the div size. I need to show the full image like in the image.
<div onmouseover="this.className='msgHover'"></div> `
above is the code on div. and my css class is
.msgHover
{
background-image: url('Images/MsgHighlight.png');
overflow:auto;
}

You can't just make the background image overflow the boundaries of the div. You can, however, make the whole div overflow it's own boundaries by using a negative right margin:
#mydiv:hover
{
margin-right: -50px;
}
This will make the entire div go wider without pushing any other elements or affecting the layout of the site what so ever. This sounds like exactly what you're trying to do. Here's an example.
Using this method you won't have to cheat using two divs in the first place and can just apply your background image on the one div.
Have a look at this example where the right margin is animated to go negative on hover.

Related

How to center a div around another element?

I'm trying to edit a tumblr theme to make my posts centered inside of an image (the image is in a div) I've tried giving the posts and div the same margin in CSS but I can't seem to get the image inside the div to center correctly on the page. I want the posts to be perfectly centered horizontally inside the image even when the browser window is resized. Anybody know how i can do this? Is there an easier way than having the image in a div? here is a link to my code
http://pastebin.com/x6MP6EYQ
First of all i would recommend using image as a background image. Would be easy to handle it as it will not affect other things inside a div.
Second, if you were to use image you would position it absolutely which mean main div should be positioned relatively. Then once image has been positioned i.e. top:0; left:0; put z-index:-100; so that way it will be always behind.
To make div always be centered both horizontally, vertically and in both directions. See my example. Here:
http://jsfiddle.net/techsin/TfLTR/
try style=aligen:center;
just you can manage by style sheet tag like padding and margin also .

How to make the content inside a div that's under another one accessible/clickable?

I have two divs: one that's fixed positioned on top of another which holds the content and scrolls under the first. The first (top) div has a triangular png background. When the content of the second div scrolls under the transparent area of the first div, how could I possibly make that overlapping area still accessible/clickable? You can see a clearer scheme at this link:
Thanks a lot!
try using the pointer-events css option
#div1 {
pointer-events:none;
}
example of it working here -> http://www.searchlawrence.com/click-through-a-div-to-underlying-elements.html
reduce the height of the top div. for an example around 20%. Then make the over-flow option to
overflow: visible;

div with gradient for text to fade - overflow auto

I'm new here so forgive if anything sound very noobish.
I'm busy making a personal website and have two divs inside a wrapper, a content div and a sidepane div. their height is set on 99% and they overflow on auto. I want the page to not scroll (unless they make the screen smaller) but the divs must scroll.
The Problem: I want to have the bottom text of the divs to fade away so that when you scroll down the div it brings the text to normal. I could use a gradient image or just CSS if someone could lead me in the right direction. I'm struggling with this cause of the overflow. I want to know how one could keep the gradient at an absolute position at the bottom of the div, but now its not really at the bottom of the div if you get what I'm saying? Because the div has overflow on. I want it at the position where the div ends on the screen, but not where the text ends. I tried putting my code in
Here's a pic
If you check the right div, I want the bottom to be faded and as I scroll the gradient stays there at the bottom. (which is not actually the bottom of the div) - also need to be able to resize page and it stays in same position.
The key is background-position: fixed;
I have created a little fiddle for you to see what i mean: Click me
I just hope i understood your problem correctly without any code and just a screenshot ;)
Also for CSS gradients see here

CSS center cropped image of variable dimensions

I am trying to display a cropped center area of an image and have it work for different size images.
I had success setting a fixed width for the div containing the image and using overflow:hidden property, this works the way I'd like it to except this only shows the leftmost part of the image and the right side is hidden.
What I'd like is to display the center part of the image and have the left and right sides of the image hidden.
I'd go with the approach of making it a background image
.imghider {width:100px; background-image:url(./qed.jpg); background-position:center center;background-repeat:no-repeat;}
<div class="imghider"> </div>
As for different sizes you could use several classes or CSS expressions (or server side css generation)
I hope this helps.

CSS visual flick

My CSS knowledge is very limited, so I'm putting my problem here hoping for the best.
I'm using this box: http://www.456bereastreet.com/lab/flexible_custom_corners_borders/ in my website, and I need to display content in two columns format.
I've attempted with the simple table, and using divs with float set (needed clearfix so the parent got its height). My problem is a visual bug that appears of the left side.
Only happens with table and div floated. p, h1, etc works fine.
Here is a picture of the bug: http://img18.imageshack.us/img18/8783/imagem2hdp.png
Thanks
edit:
Here's the code: http://dl.getdropbox.com/u/178438/css_test.zip
You should set a background color for .content this will hide that part of the border image.
--edit below--
The extra whitespace between the gradient and the border looks like an element is being pushed sideways, when it's really all part of the left border background image which is the second main div.
div // Right border
div // Top border with corner sub divs
div // Left border
div // Content
div // Bottom border with corner sub divs
Since the content part of the box is inside the left border div and the border background image is done sprite style with multiple images put together in a larger image the only CSS only solution to this is to apply a background color to the content area to cover the left background image (like the Left background div is doing to the right background div)
There are other ways to fix this such as separating the images out into separate files or moving the Content div outside of the Left border div, but at that point you aren't really using that same box anymore.

Resources