i missed you
can you help me? i have such style
.lorry{
background: url(../img/lorry.png);background-repeat:no-repeat;
_background: none;
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/lorry.png');
height: 143px;
width: 385px;
float: left;
margin: 39px 0 0 0;
}
I want to add usemap on image, is it possible?
You can't put an imagemap in a background. If you need this functionality you will have to layer objects to achieve the same thing:
First layer: just your image (not bound to imagemap)
Second layer: the contents of the container that you want to appear over the
"background"
Third layer: another copy of the image bound to the
image map, but transparent.
Here's an example: http://jsfiddle.net/jamietre/fgeee/1/
Below is the general construct to achieve this effect. It works by having an imagemap on the topmost layer (so it will be active), but bound to a transparent image. The actual image you see is behind everything, and is not transparent.
You can also do this with two layers by skipping the first image, and assigning it as a background to the layer2 div. This will only work if you are going to display the image at its native resolution, so may be fine, but this answer is more general purpose.
<div id="wrapper">
<img id="layer1" src="some/image.jpg">
<div id="layer2" style="position: absolute; top: 0; left: 0;">
Your content here
</div>
<img id="layer3"
style="position: absolute; top: 0; left: 0; opacity:0; *filter: Alpha(opacity=0);"
usemap="#your-map" src="some/image.jpg">
</div>
Notes:
The wrapper is required to make the absolute positioning work
the *filter: .. css is to supporter IE <8 which doesn't understand opacity.
I just come up here because I was trying do the same, and I found one one to use "map" without image.
As the other folks said, isn't possible use maps without image, but we can use DIV instead.
What you do is, you place a div over the main image and create a link for that DIV, below follows my code:
HTML
<div id="progress">
<a id="link1" title="Symbol Link" href="#">Symbol Link</a>
<a id="link2" title="Stack Link" href="#">Stack Link</a>
<a id="link3" title="Overflow Link" href="#">Overflow Link</a>
</div>
CSS
#progress {
width: 257px;
height: 84px;
background:url(http://upload.wikimedia.org/wikipedia/en/9/95/Stack_Overflow_website_logo.png);
position:relative;
}
a#link1, a#link2, a#link3 {
display: block;
overflow: hidden;
position: absolute;
background: transparent;
text-indent: -9999px;
}
#link1 {
left: 10px;
width: 45px;
height: 84px;
}
#link2 {
left: 55px;
top: 45px;
width: 70px;
height: 39px;
}
#link3 {
top: 45px;
left: 124px;
width: 130px;
height: 39px;
}
jsFiddle of my example.
Reference: CSS image maps
Using an imagemap on an object with a background-image is not possible. The usemap attribute requires an image (img tag).
Reference: http://www.w3schools.com/tags/att_img_usemap.asp
Related
I'm using Wordpress and have installed a plugin for WooCommerce that creates a zoom window for the product image. However, I can't get the zoom window to appear on top of the original product image. The code looks like this:
<div class="yith_magnifier_zoom_wrap">
<a class="yith_magnifier_zoom woocommerce-main-image" title="orange-slices" itemprop="image" href="orange-slices.jpg">
<img class="attachment-shop_single wp-post-image" width="300" height="300" alt="orange-slices" src="orange-slices.jpg">
</a>
<div class="yith_magnifier_mousetrap" style="width: 100%; height: 100%; top: 0px; left: 0px; cursor: pointer;"></div>
<div class="yith_magnifier_zoom_magnifier" style="left: 0px; top: 0px; width: 300px; height: 300px; background-repeat: no-repeat; background-image: url('orange-slices.jpg'); display: block; background-position: -7px -7px;"></div>
You can see the issue here: WooCommerce product page
I'm trying to center align the zoom window div .yith_magnifier_zoom_magnifier on top of the image div .yith_magnifier_mousetrap. I've managed to center it by making it relative and using margin:0 auto; but it now appears directly beneath the product image.
Unfortunately there's all sorts of inline rules applied by the theme and the plugin, so I need to override that, but I also need to keep the solution responsive as the product image height could vary. Any suggestions would be really welcome. Thankyou.
In this way you don't need any magic number (e.g. a specific pixel size in the CSS):
.yith_magnifier_zoom_magnifier {
position: absolute !important;
margin: 0 auto !important;
left: 0;
right: 0;
}
.yith_magnifier_mousetrap {
top:-366px!important;
}
I think that is what you are trying to achieve?
EDIT
.yith_magnifier_zoom_magnifier {
position: absolute !important;
margin: 0 auto !important;
height: 100%!important;
top: inherit!important;
bottom: 100%;
left: 50%!important;
margin-left: -150px!important;
}
As shown below, how to create with css to which if users save the image to his/her machine image should be square and full width and height as original picture.
You can achieve this effect by setting the border radius of the image container, and applying a hidden overflow value. An example is here - http://jsfiddle.net/8jbD5/1
your html would be something like:
<div id="imgCont">
<img src="theimage.jpg" />
</div>
and the css:
#imgCont{border:8px solid #f00;border-radius:50%;overflow:hidden;width:200px;height:200px}
#imgCont img{width:100%;height:100%;}
I hope this helps...
See this example: http://dabblet.com/gist/5450624 (Tested on Firefox 20/Chrome).
I used a 400x400 jpg image and I've adjusted its top/left offset.
relevant CSS
div {
position: relative;
width: 0;
height: 0;
border: 180px silver solid;
-webkit-border-radius: 180px;
-moz-border-radius: 180px;
border-radius: 180px;
}
figure {
position: absolute;
top: -120px;
left: -180px;
width: 200px;
height: 200px;
border: 10px red solid;
overflow: hidden;
-webkit-border-radius: 120px;
-moz-border-radius: 120px;
border-radius: 120px;
}
img {
position: absolute;
z-index: 1;
left: -100px;
top: -100px;
}
Markup
<div>
<figure>
<img src="...">
</figure>
</div>
Sample Output
You have a few choices.
Firstly, you could have an element (say a div) with its background image as your original image. Then inside that div you had an image with part transparency for the inside of the inner circle, so that the original image shows through underneath.
Secondly, you could do similar to above, but instead of using a transparent image you could create circles using a mixture of CSS and HTML. There's some nice demos here.
Thirdly, and probably the most hacky way, would be to just put everything in to one image (like in your question) and use .htaccess to serve a different file on direct access. You may not get very reliable results though. Here's a nice SO answer which explains.
how to overlay a play button png over a thumbnail image that links to a shadowbox vimeo video
The shadow box works, thats not the issue. The issue implementing the transparent Play button over the thumbnail
html:
enter code here
<div class="postsingle">
<a href="http://player.vimeo.com/video/55138154" rel="Shadowbox" title="demo">
<img class="demothumbnail" src="https://secure-b.vimeocdn.com/ts/410/203/410203139_640.jpg" alt="thumbnail image">
<span class="playIcon"><img src="images\PlayButton.png"> </span>
</a>
</div>
css:
.postsingle {
margin:10px 4px 0 12px;
border: 2px solid black;
}
.demothumbnail{
position: absolute;
width: 400px; height: auto;
z-index: 1;
}
.demothumbnail span.playIcon{
float: auto;
position:absolute;
z-index: 0;
}
please help
Why the float: auto declaration?
The .playIcon span is NOT nested in .demothumbnail, that's why your CSS rule is not applying.
If you want the play icon overlay to stretch across the entire thumbnail, use:
.postSingle a {
position: relative; /* The parent has to be set to relative */
}
.playIcon {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 10;
}
If you mean you want to select the direct sibling of .demothumbnail, then use: .demothumbnail + .playIcon. See more details on sibling and child selectors here.
p/s: Please use a Fiddle to illustrate your issue in the future.
I have this landing page. I'd like the email to be a link to mailto:info#domain.tld.
I tried to use a map (usemap="#mail" on body and then map name="mail">) but it doesn't work. I tried also with a blank transparent png image (to set the usemap to) but the link isn't clickable.
How can I achieve the area of the email to have a link upon it? Of course it should work on different resolutions.
Why don't you just render the email link as text? It looks like it can be similar to Open Sans: http://www.google.com/webfonts/specimen/Open+Sans
You could do something like this:
ADD CSS:
div#mail {
margin-left: 67%;
margin-top: 31.8%;
overflow: hidden;
width: 16%;
}
a {
color: transparent;
}
ADD HTML:
<div id="mail">info#gioiellidisapone.it</div>
Demo: http://jsfiddle.net/fXats/
It's not perfect, but maybe it's good enough. :)
This is how I modified your page directly using Inspect element, and the link stays on top of the image text. This is another option, but has fixed width and height to support the positioning of the email.
<body>
<div style="
width: 1430px;
position: absolute;
border: 1px solid #000;
height: 700px;
background-image: url(home2.jpg);
background-repeat: no-repeat;
background-position: top center;
display: inline-block;
"><a href="#" style="
position: relative;
top: 450px;
right: 294px;
display: inline-block;
float: right;
">Info#gioiellidisapone.it</a>
</div>
</body>
I want to mask out part of an image on a page, making part of the image darker so a highlighted portion stands out. (This is often used to preview the effect of the crop tool in photo editors.)
Currently, my plan involves loading two copies of the images on top of each other and using clip: rect(); to slice out of a portion of the top image. Is there a better way to handle this? I should also mention that my image is actually an animated GIF (oh dear ...)
I thought it best to figure this out before I started trying to update the crop with javascript.
CSS:
.container {
width: 1075px;
margin: 10px;
border: 1px solid black;
padding: 10px;
overflow: auto;
}
.image-container {
position: relative;
clear: both;
background-color:#eee;
}
.background{
opacity:.40;
}
.highlight {
position: absolute;
top: 0px;
left: 0px;
clip: rect(126px 257px 197px 156px);
}
HTML:
<div class="container">
<div class="image-container">
<img class="background" src="animate.gif" width="1075" height="605" />
<img class="highlight" src="animate.gif" width="1075" height="605" />
</div>
</div>
Position the image using position: absolute for each image. The layer above should be smaller then the bottom one. Than use background-position: x y;
Something like this:
#image1, #image2 {
position: absolute;
left: 0;
top: 0;
background: url('https://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif')
}
#image1 {
min-width: 276px !important;
min-height 110px !important;
opacity: 0.5;
}
#image2 {
left: 251px;
width: 25px;
height: 110px;
background-position: 100% 100%;
}
Look here an example:
http://jsfiddle.net/8n3Rr/
Try to position a <div> over the images, put a low opacity on it and a width or height half the size of the image.