create image map with css? - css

i create image map with css but don't work.
i have a image in background and i want to create a image map for background picture .but when my mouse hover an link background image not change.
this is my html code.
<section id="centersectioncontact" class="colortext">
<ul id="cantact">
<li id="linkin">Link in </li>
<li id="twiter"> twiter</li>
</ul>
</section>
and this is my css code.
#centersectioncontact {
position: absolute;
top: 14%;
left: 31%;
width: 426px;
height: 426px;
bottom: 25%;
right: 25%;
z-index: 2;
}
ul#cantact
{
list-style:none;
background:url(../Images/contact.png) no-repeat 0 0 ;
position:relative;
width:426px;
height:420px;
margin:0;
padding:0;
opacity:0.5;
}
ul#cantact li{
position: absolute;
border: 1px solid #000;
}
}
ul#cantact a{
display: block;
height: 100%;
text-indent: -9000px;
}
#linkin {
width: 215px;
height: 140px;
top: 0px;
left: 0px;
}
#twiter
{
width: 215px;
height: 140px;
top: 0px;
left: 215px;
}
ul#cantact li a:hover {
background:url(../Images/contact.png) no-repeat 0 0;
}
ul#cantact li#linkin a:hover {
background-position: 0 -426px;
}
ul#cantact li#twiter a:hover{
background-position: 0 -426px;}
.colortext{
margin-top: 7px;
margin-left: 16px;
top: 2%;
left: 2%;
color: #FFFFFF;
text-align: left;
font-size: xx-large;
z-index: 10000000;
}

there is a couple of contradictions in your css code. One of these and an extra '}' cause the problem:
from
ul#cantact li{
position: absolute;
border: 1px solid #000;
}
}
delete the extra "}"
and you should remove also:
ul#cantact li#linkin a:hover {
background-position: 0 -426px;
}
ul#cantact li#twiter a:hover{
background-position: 0 -426px;
}
In the code you have already defined background-position as 0 0 in
ul#cantact li a:hover {
background:url(../Images/contact.png) no-repeat 0 0;
}
And besides, with the -426px horizontal setting the img won't reveal on the screen.

Related

How to make right side in css oblique?

I want to make background for menu list item looks as a tab, how can this be done in CSS and to add icon beside it
CSS
#cdnavheader .activeMenuItem span {
background-position: 100% -145px;
color: #2d83ab;
padding: 12px;
background-repeat: no-repeat;
color: #fff;
background-color: #2d489b;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
You can also use a pseudo and transform:
a {
display: inline-block;/* fallback*/
position: relative;
overflow: hidden;
border-radius:5px 5px 0 0;
padding: 1em 3em 1em 2em;
}
a:before {
content: '';
position: absolute;
top: 0;
right: 0;
width: 120%;
height: 200%;
z-index: -1;
background: tomato;
border-radius:inherit;
transform: skew(35deg)
}
nav {
display: flex;
margin: 1em;
}
<nav> some link
some link
some link
</nav>
Use a zero height DIV with a big border:
.tab {
width: 100px;
height: 0px;
border-right: 20px solid transparent;
border-bottom: 20px solid green;
}
<div class="tab"></div>
More info here: https://css-tricks.com/snippets/css/css-triangle/

Span inside div is crossed by div

<div class="message-unread-headline" id="message-unread-headline" style="display: none;">
<span>Unread Messages</span>
</div>
.message-unread-headline {
color: #e91e63;
display: none;
margin: 0 10px -10px;
position: relative;
text-align: center;
&:before {
background: #e91e63;
content: '';
height: 2px;
left: 0;
padding: 0 10px;
position: absolute;
top: 0;
width: 100%;
}
span {
background: transparent;
display: inline-block;
height: 30px;
padding: 0 10px;
position: relative;
top: -11px;
}
}
this is how it looks
I would like that pink line stops as soon as reaches the Unread Message Text
I tried with z-index, but it doesn't work. Don't know the way how to prevent that overlaying
That's how I achieved this:
.message-unread-headline {
margin:0;padding:0 10px;
background:#fff;
display:inline-block;
color: #e91e63;
}
h2{
text-align:right;
position:relative;
z-index:2;
}
h2:after{
content:"";
position:absolute;
top:50%;
left:0;
right:0;
border-top:solid 2px #e91e63;
z-index:-1;
}
<h2>
<span class="message-unread-headline">Unread Messages</span>
</h2>
Check if this could help you.
I have removed width: 100% and added right: 0 to :before
And give background: #fff; to span
.message-unread-headline {
color: #e91e63;
position: relative;
text-align: right;
}
.message-unread-headline:before {
background: #e91e63;
content: '';
height: 2px;
left: 0;
padding: 0 10px;
position: absolute;
top: 0;
right: 0;
}
.message-unread-headline span {
background: #fff;
padding: 0 10px;
position: relative;
top: -11px;
}
<div class="message-unread-headline" id="message-unread-headline" >
<span>Unread Messages</span>
</div>
If your purpose is just strike over a text you can go for strike tag in html

Huge White Field in Footer on Specific Device

It's not visible everywhere, just on some devices. Literally a huge white field below footer. Another person has shown it to me, it's not visible even on my PC.
Here's a visualisation of what I am talking about: nikosis.mzonespace.co.uk/108.jpg
Here's a CSS code:
Footer
//=======================================================================*/
#footer {
position: relative;
}
#footer .widget{
margin: 0;
}
#footer .ft-bg{
background: url("../images/icons/bg-slider-matt-1.png") repeat-x top center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
-ms-transform: rotate(180deg); /* IE 9 */
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
}
#footer .ft-bg.style2{
background: url("../images/icons/bg-footer-style2.png") repeat;
top: 100px;
bottom: 80px;
opacity: 0.2;
}
#footer .ft-img{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
}
#footer .ft-img img{
width: 100%;
max-width: none;
height: auto;
}
#footer a{
color:#efefef;
}
#footer h3 span{
text-transform: uppercase;
font-size: 24px;
font-weight: 300;
color: #464646;
}
#footer-wrapper{
color: #464646;;
padding:163px 0 0;
width: 100%;
max-width: 1170px;
margin: 0 auto;
font-size: 13px;
font-weight: 400;
position: relative;
}
.footer-top{
background:url("../images/icons/bg-dot.jpg") repeat-x ;
/*margin-bottom: 150px;*/
}
.style2 .footer-top{
background:none;
/*padding-top:74px;*/
}
.footer-top .span4{
padding-right: 120px;
}
.footer-top .span4:last-child{
padding-right: 0;
}
.footer-bottom{
color: #fff;
font-size: 14px;
font-weight: 300;
padding-bottom: 30px;
padding-top: 25px;
}
.style2 .footer-bottom{
color: #464646;
padding-top: 50px;
}
.footer-bottom .span6:last-child{
text-align: right;
font-size: 15px;
}
#copyright-wrapper {
font-size:12px;
padding: 15px 0;
background-color:#fff;
}
#copyright-wrapper [class*="span"]{
min-height:1px;
}
#copyright-wrapper #secondary-nav ul{
margin:0;
}
#copyright-wrapper #secondary-nav ul li{
line-height:100%;
padding:0 10px;
border-left:1px solid rgba(255, 255, 255, 0.1);
}
#copyright-wrapper #secondary-nav ul li:first-child{
border:none;
}
.scrollTop{
position:fixed;
bottom: 55px;
right:15px;
display:none;
}
.scrollTop a{
text-indent:-9999px;
background: #d3d3d9 url(../images/icons/scroll-top.png) no-repeat center;
width:40px;
height:40px;
display:block;
}
/*=========================================================================
Here's the page: nikosis.mzonespace.co.uk/blog-full-layout/
I have noticed that after the layout collapses for mobile/tablet, the white area appears. The corresponding CSS is called #footer-wrapper.
#footer-wrapper: padding-top:400px;
It should be in a file called responsive.css .. I have removed the padding and the white area disappeared. Also, the footer-wrapper contains some test1 and test2. I don't see any codes or other content loaded in it. So, you might as well remove it from your code. Or even set it to display:none in case you don't know where is it. However, since you are on wordpress, it could be in your template files in footer.php or something similar.
Hope this helps!

Assistance require for css hover image

I am on the process in learning css.
I am trying to display the image in the middle of the screen upon user hover their mouse in the gallery.
however, the image hover within the image itself.
this is my code.
jsfiddle.net/y9w5ym72/1/
body {
margin: 0;
padding: 0;
background: #EEE;
font: 10px/13px 'Lucida Sans',sans-serif;
}
.wrap {
overflow: hidden;
margin: 50px;
}
.box {
float: left;
position: relative;
width: 25%;
padding-bottom: 25%;
color: #FFF;
}
.boxInner {
position: absolute;
left: 30px;
right: 30px;
top: 30px;
bottom: 30px;
overflow: hidden;
background: #66F;
}
.boxInner img {
width: 100%;
}
.thumbnail:hover img{
border: 1px solid transparent;
}
.thumbnail span{
position: absolute;
padding: 5px;
left: -1000px;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail span img{
border-width: 0;
width:70%;
height: auto;
padding: 2px;
}
.thumbnail:hover span{
visibility: visible;
top: 0;
left: 230px;
z-index: 50;
}
First point is you need to hide the first image. So that only you can see the second one. Second point is no need position:absolute, left:-1000px; styles for the inside span.
.thumbnail:hover > img{
border: 1px solid transparent;
display:none;
}
.thumbnail span{
/*position: absolute;
left: -1000px;*/
padding: 5px;
visibility: hidden;
color: black;
text-decoration: none;
}
DEMO
you have to use position :absolute to achieve that fiddle
.box:hover{position:absolute; top:38%; left:38%; z-index:200;}

Breadcrumb's triangles using images and :before, :after pseudoelements

Problematic part:
.breadcrumbs a:before, .breadcrumbs span:before {
background: url('');
width: 10px;
height: 20px;
background-position: 0 -147px;
content: '';
position: absolute;
}
I am trying to make some padding for the text but I can't find any workaround that wouldn't affect image from the :before pseudoelement.
Here's my code: http://jsfiddle.net/ZARUz/
I am trying to obtain that effect: http://cl.ly/SVBR
http://jsfiddle.net/TreeTree/ZARUz/12/
.breadcrumbs a, .breadcrumbs span {
height: 20px;
background: url('http://s1.pixelize.pl/breadcrumb.png');
background-position: 0 -21px;
display: inline-block;
position:relative;
padding-right:10px;
}
.breadcrumbs a:after, .breadcrumbs span:after {
background: url('http://s1.pixelize.pl/breadcrumb.png') white;
width: 10px;
height: 20px;
background-position: 0 -63px;
content:'';
position: absolute;
right:0;
}
.breadcrumbs a:before, .breadcrumbs span:before {
background: url('http://s1.pixelize.pl/breadcrumb.png');
width: 10px;
height: 20px;
background-position: 0 -147px;
content:'';
position: absolute;
left:-10px;
}
Your pseudos weren't given left and right properties which made them slightly unpredictable.
I assumed by
that wouldn't affect image from the :before pseudoelement.
you meant modifying the actual image file, so this method doesn't do that.
Need to position your before and after "blocks" so the backgrounds can appear correctly.
A JSFiddle Lives Here
.breadcrumbs a, .breadcrumbs span {
height: 20px;
background: url('http://s1.pixelize.pl/breadcrumb.png');
background-position: 0 -21px;
display: inline-block;
position: relative;
padding: 0 10px;
margin-right: 30px;
}
.breadcrumbs a:after, .breadcrumbs span:after {
background: url('http://s1.pixelize.pl/breadcrumb.png');
width: 10px;
height: 20px;
background-position: 0 -63px;
content: '';
position: absolute;
right: -10px;
}
.breadcrumbs a:before, .breadcrumbs span:before {
background: url('http://s1.pixelize.pl/breadcrumb.png');
width: 10px;
height: 20px;
background-position: 0 -147px;
content: '';
position: absolute;
left: -10px;
}

Resources