javascript - half borders at top right corner and bottom left corner with css -



javascript - half borders at top right corner and bottom left corner with css -

i have few images i'd half borders top right corner , bottom left corner. problems running are:

problem 1: have managed cutting of borders @ 4 corners, can't cutting of top left , bottom right. code below (i'm using fiddle provided killacam, , experimented little, result 4 corners appear @ first , 3 of them disappears! : http://jsfiddle.net/3jo5btxd/

#div1 { position: relative; height: 100px; width: 100px; background-color: white; border: 1px solid transparent;transition: border 2000ms ease 0s; } #div2 { position: absolute; top: -2px; left: -2px; height: 84px; width: 84px; background-color: #fff; border-radius: 15px; padding: 10px; }

problem 2 have panel has link vertically centered using css table method, visible on hover. when combine panel's code corner borders, vertical centering goes out of whack! guess happening because of div using borders, haven't managed create corners :before (doesn't work on hover). html , css below , image showing want make:

<ul class="img-list"> <li class="category_lists one-third column-block" '=""> <a href="http://kohphangan.smartsolutionpro.us/category/adventure/"> <img src="something.jpg"/> <span class="text-content"> <span>adventure</span> </span> </a> </li> <li class="category_lists one-third column-block" '=""> <a href="http://kohphangan.smartsolutionpro.us/category/beach-2/"> <img src="something2.jpg" /> <span class="text-content"> <span>beach</span> </span> </a> </li> </ul>

css:

/*css categories on home page*/ .img-list{margin:0;padding:0; list-style:none} ul.img-list li { display: inline-block; height: 20em; margin: 0; position: relative; } .category_lists.one-third{width:33%; margin-left:0;} .category_lists img{width:100%; height:auto;} span.text-content span { display: table-cell; text-align: center; vertical-align: middle; } span.text-content { background: rgba(38,196,83,0.7); color: white; cursor: pointer; display: table; height: 7em; left: 0; position: absolute; top: 0; width: 100%; opacity: 0; -webkit-transition: opacity 500ms; -moz-transition: opacity 500ms; -o-transition: opacity 500ms; transition: opacity 500ms; font-size:42px; text-transform:uppercase; font-family: 'raleway', sans-serif; font-weight:300 } ul.img-list li:hover span.text-content { opacity: 1; }

and image showing want make: http://tinypic.com/r/2gy5zk4/8 .

if have utilize javascript, will, not @ it, counting on css create work. lot help.

here's 1 solution: http://jsfiddle.net/f7u6yxlq/.

html:

<div></div>

css:

* { margin: 0; padding: 0; } body { padding: 10px; } div { position: relative; display: table; width: 200px; height: 100px; background: url("http://placehold.it/200x100") no-repeat top left; } div:before, div:after { content: ""; position: absolute; width: 50px; height: 50px; border: solid white; border-width: 2px 2px 0 0; display: none; } div:before { right: 5px; top: 5px; } div:after { border-width: 0 0 2px 2px; bottom: 5px; left: 5px; } div:hover:after, div:hover:before { display: block; }

javascript jquery html css css3

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -